openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
GNU Affero General Public License v3.0
633 stars 371 forks source link

Make it super easy to translate content pages #2042

Open teolemon opened 5 years ago

teolemon commented 5 years ago
langcode
langname
templateid
percentage = count(msgstr)/count(msgstr.empty)

This page is 17% translated to Romanian. You can help improve that by clicking here.


<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/251/en-fr">code-of-conduct.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/252/en-fr">contact.en.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/253/en-fr">contribute.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/254/en-fr">data.en.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/255/en-fr">discover.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/270/en-fr">experimental-nutrition-score-france.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/256/en-fr">faq.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/257/en-fr">how-to-add-a-product.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/258/en-fr">index.en.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/259/en-fr">index.foundation.en.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/260/en-fr">legal.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/261/en-fr">missions.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/279/en-fr">nova-groups-for-food-processing.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/262/en-fr">nutrition-score-uk.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/263/en-fr">open-food-hunt-2015.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/264/en-fr">press-and-blogs.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/265/en-fr">press.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/396/en-fr">producers.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/266/en-fr">products.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/269/en-fr">rateyourvendingmachine.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/271/en-fr">scan-parties.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/267/en-fr">terms-of-use.html</a>
<a href="https://translate.openfoodfacts.org/translate/openfoodfacts/268/en-fr">who-we-are.html</a>

251 >> code-of-conduct.html
252 >> contact.en.html
253 >> contribute.html
254 >> data.en.html
255 >> discover.html
270 >> experimental-nutrition-score-france.html
256 >> faq.html
257 >> how-to-add-a-product.html
258 >> index.en.html
259 >> index.foundation.en.html
260 >> legal.html
261 >> missions.html
279 >> nova-groups-for-food-processing.html
262 >> nutrition-score-uk.html
263 >> open-food-hunt-2015.html
264 >> press-and-blogs.html
265 >> press.html
396 >> producers.html
266 >> products.html
269 >> rateyourvendingmachine.html
271 >> scan-parties.html
267 >> terms-of-use.html
268 >> who-we-are.html
stephanegigandet commented 5 years ago

How can I get or compute the % of translation?

percentage = count(msgstr)/count(msgstr.empty)

--> In git /lang/[lc]/texts/nutriscore.html etc. I only have the resulting HTML.

hangy commented 5 years ago

The problem is that your local value won't necessarily match the completness score of the current version on Crowdin. IMHO, the current values from Crowndin need to be used, therefore we need to investigate if the Crowdin API supports returning the % values that they already compute.

VaiTon commented 4 years ago

@stephanegigandet @teolemon can we close this?

CharlesNepote commented 4 years ago

@VaiTon thanks for the reminder and your efforts to close issues :+1: but I'm afraid we can't close this one. It's a very interesting need in my opinion.

I could make some tests with my Power User Script but I need to know how can I find the corresponding URL in crowdin. How do I know https://world.openfoodfacts.org/code-of-conduct is /master/lang/en/texts/code-of-conduct.html in crowdin with https://translate.openfoodfacts.org/translate/openfoodfacts/452/en-fr URL?

teolemon commented 4 years ago

@hangy @CharlesNepote there's indeed an API for this: https://support.crowdin.com/api/v2/#operation/api.projects.files.languages.progress.getMany We probably need to create a mapping between file name and file id in the config file