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

Localization #9

Closed
yayamamo opened this issue Apr 10, 2020 · 18 comments
Closed

Localization #9

yayamamo opened this issue Apr 10, 2020 · 18 comments

Comments

@yayamamo
Copy link
Contributor

I'm translating the contents into Japanese using GitLocalize.
This app supports i18n for various formats such as Markdown, PO, JSON etc. with synchronizing with a GitHub repo.
Anyone can translate into your mother language with this app, and I setup a project here.
More details please refer FAQ.

@yayamamo
Copy link
Contributor Author

After trying GitLocalize, I found the following pros/cons.

  • Pro
    • Sync with GitHub
    • Markdown support
  • Con
    • It sometimes takes time for an operation due to the limit of GitHub API.
    • You cannot commit your translation work before completing it.

@egonw
Copy link
Owner

egonw commented Apr 10, 2020

I have been doing some testing in this GitHub repo: https://github.com/egonw/l10n-test

The repository actually preprocesses .i.md files, which it converted to .md files in docs/. In those, SPARQL input is already injected. So, I want to update the build process to ensure the SPARQL against Wikidata actually uses that language too.

@yayamamo
Copy link
Contributor Author

yayamamo commented Apr 15, 2020

I've found another TMS that supports GitHub sync and the Markdown format.
https://www.transifex.com/dbcls/sars-cov-2-queries/
If the content to be translated is open, it's free of charge.
As they require me to fill in the institution name, under which translation projects are created, SARS-CoV-2-Queries is currently under dbcls.

@egonw
Copy link
Owner

egonw commented Apr 16, 2020

Thanks for accepting my request for the invitation. I have used Transifex in the past for CKAN. I'll see if I can get the build system updated this weekend! \

One note, we really have to translate the *.i.md files and not those in docs/. The latter files are autogenerated.

@yayamamo
Copy link
Contributor Author

Thanks! I've changed the config file with the directory and the extension to / and i.md, respectively, but the system doesn't seem to recognize this extension. We can see all the markdown files at the root directory to be translated.

@egonw
Copy link
Owner

egonw commented Apr 17, 2020

Regarding the problem that is does not recognize .i.md files, that I can solve by putting these files in a src/ subfolder and just naming them .md.

@yayamamo
Copy link
Contributor Author

Thanks, and I created a src/ folder and copy *.i.md files to it with changing file names. Even though I changed the config file to specify the files to be translated are at the src/ folder only, there are many i.md files at the transifex resource. Maybe I need to learn how to delete them.

@egonw
Copy link
Owner

egonw commented Apr 18, 2020

Okay, I'm making progress :) I think I have the SPARQLs now run for a set of languages :)

@egonw
Copy link
Owner

egonw commented Apr 18, 2020

Okay, first round results: https://egonw.github.io/SARS-CoV-2-Queries/nl/ :)

So, the content to translate is src/*.md and the translated files should be in src/nl/*.md (with the same file names). Replace nl with the two char code of the language. It may work for something like nl_NL too, but have not tested that yet.

@yayamamo
Copy link
Contributor Author

Can I delete all the resources at the transifex except for those in the src directory?

@yayamamo
Copy link
Contributor Author

When translating, do I need to reserve the text within the tags of <sparql> and <out>?

@egonw
Copy link
Owner

egonw commented Apr 21, 2020

Yes, keep all XML code in the files. You're fine to move it around. The "builder" uses this annotation to enrich the file:

  • <sparql> shows the SPARQL query (and makes a link to the dedicated page, "run"/"edit", etc)
  • <out> and <iframe> show the output of that query
  • <topic> is used to create the Index at the end of the book
  • <section> is used to add HTML anchors, allowing you to cite a chapter/section
  • <cite> takes an Wikidata identifier for a publication
  • <references/> creates the bibliography at the end of a page

@yayamamo
Copy link
Contributor Author

Thanks, and let me confirm.
The text within the <topic> and </topic> tags appears literally in the production document, and so I assume I can translate it into its corresponding Japanese text (e.g. <topic>virus</topic> to <topic>ウイルス</topic>).
However, the text within the <sparql> and </sparql> tags doesn't appear in the production one, and so I guess it is used to feed an actual SPARQL query.
Therefore, I shouldn't translate it into Japanese, should I?
For example, <sparql>allSARSCoVViruses</sparql> shouldn't be translated into <sparql>全SARSコロナウイルス</sparql>, is this correct?

@egonw
Copy link
Owner

egonw commented Apr 21, 2020

Ah, good point. Should have mentioned that:

Content should be translated:

  • <topic>
  • <section> (the @Label attribute should not be translated)

Content should be copied literally untranslated:

  • <sparql> (the content is a reference to .rq file with that name in the sparql/ folder)
  • <out> and <iframe> (like <sparql>)
  • <cite>

@egonw
Copy link
Owner

egonw commented Apr 21, 2020

One further comment about <topic>. Please adapt where needed to the translation. From past translation work, sometimes it makes sense to use the <topic> annotation creatively, to fit how the full sentence is translated. This is, for example, the case when the topic is broken up in words in one language, but not the other.

@egonw
Copy link
Owner

egonw commented Apr 27, 2020

@yayamamo, I think we're almost there. There are two further places that need to become Java property files at some point, but quite manageable at this moment. Can you please translate the following strings used in templates into Japanese, plz?

There likely will be one or two more later on.

@egonw
Copy link
Owner

egonw commented May 2, 2020

Update: the translations are now linked from each other:

image

@egonw
Copy link
Owner

egonw commented Jun 1, 2020

Okay, it's all up and running. I'm not excited with the long patches being created by the translation tool, but can isolate the new patches without much effort.

@egonw egonw closed this as completed Jun 1, 2020
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

No branches or pull requests

2 participants