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

Add Brazilian Portuguese translations to MathJax #491

Closed
he7d3r opened this issue Jun 6, 2013 · 8 comments
Closed

Add Brazilian Portuguese translations to MathJax #491

he7d3r opened this issue Jun 6, 2013 · 8 comments
Labels
Accepted Issue has been reproduced by MathJax team Test Not Needed v2.3
Milestone

Comments

@he7d3r
Copy link

he7d3r commented Jun 6, 2013

I've added the pt-br translations of MathJax as attachments on
https://bugzilla.wikimedia.org/show_bug.cgi?id=49267

Could someone (double-check and) submit them on github?

@mattflaschen
Copy link

Yeah, I'll do it. For future reference, you should start from the version in side the 'unpacked' directory. MathJax has both compiled files and source code in their git repo. The source code is in 'unpacked'.

I think the best approach is to submit it for both pt and pt-br, since they don't have language fallback yet (issue #492).

@he7d3r
Copy link
Author

he7d3r commented Jun 6, 2013

Thank you!

@fred-wang
Copy link
Contributor

@mattflaschen @helder-git

Thank you very much for your contribution! And apologies that's the interface for contributing new languages is still not completely ready yet...

I've created a new branch issue491 that essentially includes your changes with the following modifications:

  • For numbers, it seems that decimal comma are used in Brazil/Portugal (https://en.wikipedia.org/wiki/Decimal_mark#Countries_using_Arabic_numerals_with_decimal_comma) so I've updated the number function

  • I've removed the Portugal translation data and added instead a "remap" property to fallback to "pt-bz".

  • I've escaped the non-ASCII letters with the command

        ls *.js | xargs sed -i 's/\à/\\u00E0/g'; \
        ls *.js | xargs sed -i 's/\á/\\u00E1/g'; \
        ls *.js | xargs sed -i 's/\â/\\u00E2/g'; \
        ls *.js | xargs sed -i 's/\ã/\\u00E3/g'; \
        ls *.js | xargs sed -i 's/\é/\\u00E9/g'; \
        ls *.js | xargs sed -i 's/\ê/\\u00EA/g'; \
        ls *.js | xargs sed -i 's/\í/\\u00ED/g'; \
        ls *.js | xargs sed -i 's/\ó/\\u00F3/g'; \
        ls *.js | xargs sed -i 's/\ô/\\u00F4/g'; \
        ls *.js | xargs sed -i 's/\õ/\\u00F5/g'; \
        ls *.js | xargs sed -i 's/\ú/\\u00FA/g'; \
        ls *.js | xargs sed -i 's/\ü/\\u00FC/g'; \
        ls *.js | xargs sed -i 's/\º/\\u00BA/g'; \
        ls *.js | xargs sed -i 's/\ª/\\u00AA/g'; \
        ls *.js | xargs sed -i 's/\ç/\\u00E7/g'; \
        ls *.js | xargs sed -i 's/\ñ/\\u00F1/g'; \
    

Please confirm if everything is still fine.

@dpvc Can you please have a look at the changes to MathJax.Localization, especially to the remap / getLocale code?

=> Ready For review

@ghost ghost assigned fred-wang Jun 17, 2013
@mattflaschen
Copy link

I tested pt, pt-br, and a couple others, and it seems fine. The \u escapes do make the source less readable, but I assume you're doing this for compatibility with mis-configured servers or something. It shouldn't be a big deal once TranslateWiki (issue #493) is up and running.

@fred-wang
Copy link
Contributor

@helder-git @mattflaschen As I said on issue 493, I've merged all the i18n changes to https://github.com/fred-wang/MathJax/tree/i18n. You might want to try the test/localization.html to test the localization in context.

@mattflaschen
Copy link

@fred-wang , that branch (https://github.com/fred-wang/MathJax/tree/i18n/localization) does not seem to have pt or pt-br yet.

@fred-wang
Copy link
Contributor

@mattflaschen Sorry, I should have say that the data are only in the unpacked directory for the moment: https://github.com/fred-wang/MathJax/tree/i18n/unpacked/localization

@fred-wang
Copy link
Contributor

To avoid confusion, I'm closing this issue. The changes have been reviewed by @mattflaschen and are committed here: https://github.com/mathjax/MathJax-i18n/tree/master/JSON/pt-br

We'll use this MathJax-i18n repository as a reference point for future translations imported from TranslateWiki. The translation will be integrated to MathJax core when we regenerate the localization data. I'll handle #492 separately.

Thanks again for the translation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Test Not Needed v2.3
Projects
None yet
Development

No branches or pull requests

3 participants