Skip to content

Add Russian translation for footnote, email, telephone#6926

Merged
laurmaedje merged 1 commit intotypst:mainfrom
Andrew15-5:ru-translation
Oct 3, 2025
Merged

Add Russian translation for footnote, email, telephone#6926
laurmaedje merged 1 commit intotypst:mainfrom
Andrew15-5:ru-translation

Conversation

@Andrew15-5
Copy link
Contributor

@Andrew15-5 Andrew15-5 commented Sep 18, 2025

I double-checked with Wikipedia, just to be extra sure, and the translation actually matches perfectly (not really surprising, but yeah):

Linking #6619

@MDLC01
Copy link
Collaborator

MDLC01 commented Sep 19, 2025

Out of curiosity, where are the translations for "email" and "telephone" used?

@Andrew15-5
Copy link
Contributor Author

Andrew15-5 commented Sep 19, 2025

This is a question for #6619.

impl Destination {
pub fn alt_text(
&self,
engine: &mut Engine,
styles: StyleChain,
) -> SourceResult<EcoString> {
match self {
Destination::Url(url) => {
let contact = url.strip_contact_scheme().map(|(scheme, stripped)| {
eco_format!("{} {stripped}", scheme.local_name_in(styles))
});
Ok(contact.unwrap_or_else(|| url.clone().into_inner()))
}

impl UrlContactScheme {
pub fn as_str(self) -> &'static str {
match self {
Self::Mailto => "mailto:",
Self::Tel => "tel:",
}
}
pub fn local_name_in(self, styles: StyleChain) -> &'static str {
match self {
UrlContactScheme::Mailto => Email::local_name_in(styles),
UrlContactScheme::Tel => Telephone::local_name_in(styles),
}
}
}
#[derive(Copy, Clone)]
pub struct Email;
impl LocalName for Email {
const KEY: &'static str = "email";
}
#[derive(Copy, Clone)]
pub struct Telephone;
impl LocalName for Telephone {
const KEY: &'static str = "telephone";
}

const LINK_RULE: ShowFn<LinkElem> = |elem, engine, styles| {
let span = elem.span();
let body = elem.body.clone();
let dest = elem.dest.resolve(engine.introspector).at(elem.span())?;
let alt = dest.alt_text(engine, styles)?;
// Manually construct link marker that spans the whole link elem, not just
// the body.
Ok(LinkMarker::new(body, dest.clone(), Some(alt))
.pack()
.spanned(span)
.set(LinkElem::current, Some(dest)))
};

@saecki saecki force-pushed the pdf-accessibility branch 2 times, most recently from c208dab to 020109f Compare September 25, 2025 22:18
@saecki saecki force-pushed the pdf-accessibility branch 5 times, most recently from 5e4844e to 52e563e Compare October 1, 2025 07:34
@saecki saecki force-pushed the pdf-accessibility branch 3 times, most recently from 1ca5a78 to 188b977 Compare October 1, 2025 10:43
@Andrew15-5 Andrew15-5 changed the base branch from pdf-accessibility to main October 2, 2025 08:57
@laurmaedje laurmaedje added this pull request to the merge queue Oct 3, 2025
@laurmaedje
Copy link
Member

Thanks!

Merged via the queue into typst:main with commit 2179d47 Oct 3, 2025
8 checks passed
@Andrew15-5 Andrew15-5 deleted the ru-translation branch October 3, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants