Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with mdbook-i18n-helpers 3.0 in persian string #1471

Closed
moaminsharifi opened this issue Nov 11, 2023 · 1 comment
Closed

issue with mdbook-i18n-helpers 3.0 in persian string #1471

moaminsharifi opened this issue Nov 11, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@moaminsharifi
Copy link
Collaborator

PR: #1469

Wired behive in persian texts with <span dir=ltr> ... </span>
as I showed in #1439 how is important to have <span dir=ltr> ... </span> in translation file

with normalizing with version 3

#: src/SUMMARY.md:92
msgid "Double Frees in Modern C++"
msgstr "آزاد سازی مضاعف در<span dir=ltr>C++</span> مدرن"

https://github.com/google/comprehensive-rust/blob/main/po/fa.po#L302

become to:

#: src/SUMMARY.md:92
#, fuzzy
msgid "Double Frees in Modern C++"
msgstr ""
"آزاد سازی مضاعف در\n"
"\n"
"C++\n"
"\n"
"مدرن"

https://github.com/moaminsharifi/comprehensive-rust/blob/normalize-fa.po-file-with-mdbook-i18n-helpers-0.3.0/po/fa.po#L299

after seening this I darf my PRs (#1353, #1469, #1470)

@moaminsharifi moaminsharifi added bug Something isn't working invalid This doesn't seem right labels Nov 11, 2023
@mgeisler mgeisler removed the invalid This doesn't seem right label Nov 12, 2023
@mgeisler
Copy link
Collaborator

Hi @moaminsharifi, thanks for tracking this down!

You're right that there is a problem here... I had not anticipated the messages containing HTML when writing the normalization tool! The basis of the normalization is an assumption that we can run mdbook-xgettext on the translation and get the same result as what we started with.

I just created google/mdbook-i18n-helpers#125 to track fixing this.

As for your case: have you translated "many" comments and strings in the code blocks? If not, then I suggest not using mdbook-i18n-normalize on the fa.po file. Instead, run mdbook-xgettext and msgmerge to refresh the translation. This will also remove all the code blocks from your translation since they're no longer present in the messages.pot file.

However, this is of course not ideal since you'll be prevented from normalizing the file in the future. I don't think we'll make major changes that require normalization going forward, but it's hard to predict the future 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants