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

how can I extract translation percentage? #117

Open
Jibec opened this issue May 21, 2019 · 8 comments
Open

how can I extract translation percentage? #117

Jibec opened this issue May 21, 2019 · 8 comments

Comments

@Jibec
Copy link

Jibec commented May 21, 2019

hello, is there a way to have the translation progress of a fluent file?

for po files, I'm using this: http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/pocount.html

can I use python-fluent to do something equivalent?

@spookylukey
Copy link
Collaborator

You can do that with compare-locales.

I found the docs for that tool a bit impenetrable, particularly for l10n.toml, which is really a separate issue, but eventually managed to get something working with a l10n.toml file like this:

basepath = "."

locales = [
    "en",
    "tr",
]

[[paths]]

reference = "myapp/locales/en/**/*.ftl"
l10n = "myapp/locales/{locale}/**/*.ftl"
locales = [
    "tr",
]

I'll leave this ticket open as a reminder to add something to the docs about this.

@Jibec
Copy link
Author

Jibec commented May 21, 2019 via email

@Pike
Copy link
Contributor

Pike commented May 21, 2019

The file format is documented at https://moz-l10n-config.readthedocs.io/en/latest/fileformat.html, though there might be a few quirks.

The code for compare-locales is at https://hg.mozilla.org/l10n/compare-locales, so you could wrap your own project management and discovery around that.

@Jibec
Copy link
Author

Jibec commented May 21, 2019 via email

@Pike
Copy link
Contributor

Pike commented May 21, 2019

So, for Firefox, we're using cross-channel localization, and our reference strings are at https://hg.mozilla.org/l10n/gecko-strings/.

The l10n config file for Firefox in there is https://hg.mozilla.org/l10n/gecko-strings/file/default/_configs/browser.toml.

@Jibec
Copy link
Author

Jibec commented May 21, 2019 via email

@Jibec
Copy link
Author

Jibec commented May 21, 2019

Ok, it took me some times, the verbose output doesn't help much.
When it doesn't work, it doesn't work ;)
Having some hind like: "reference folder not found", "l10n folder not found" would help!

can you please tell me how to interpret the results?

fr:
missing          16
missing_w        87
obsolete         78
changed        1615
changed_w      6267
unchanged       114
unchanged_w     132
keys            275
92% of entries changed

And I tried, but I couldn't get rid of the "locales" variable. I wanted to pass it as a parameter but didn't succeed.

basepath = "."

[env]
    l = "{locale}/"

[[paths]]
    reference = "devtools/client/locales/en-US/**"
    l10n = "{l}devtools/client/**"

locales = [
    "fr",
]

@Jibec
Copy link
Author

Jibec commented Jul 26, 2019

kind reminder, can you please tell me how to interpret the results? and how to get rid of the "locales" list?

here is my understanding:

  • missing 16 <= untranslated source messages?
  • missing_w 87 <= untranslated source words?
  • obsolete 78 <= is it also counted in changed? is the unit messages?
  • changed 1615 <= translated source messages?
  • changed_w 6267 <= translated words? Is it the number of source words translated or the number of words in the translated content?
  • unchanged 114 <= to be counted as translated or untranslated messages?
  • unchanged_w 132 <= to be counted as translated or untranslated words?
  • keys 275 <= what is it?

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

3 participants