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

Enable in-line Crowdin translations for logged in users/moderators #5610

Open
1 task
teolemon opened this issue Sep 4, 2021 · 4 comments
Open
1 task

Enable in-line Crowdin translations for logged in users/moderators #5610

teolemon opened this issue Sep 4, 2021 · 4 comments
Labels
🎯 P1 ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ✅ Task Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org

Comments

@teolemon
Copy link
Member

teolemon commented Sep 4, 2021

What

  • Enable in-line Crowdin translations for logged in users/moderators

Why

  • Having a good translation loop is a good way to increase our impact.

How

Integration
Add the following JavaScript snippet to your website, on the pages, where the widget should be displayed, right before the closing tag.

<script
  type="text/javascript"
  src="https://crowdin.com/js/crowdjet/crowdjet.js">
</script>
<div
  id="crowdjet-container"
  data-project-id="243092"
  style="bottom: 90px; right: 20px;">
</div>
<div
  id="crowdjet-expand-container"
  style="bottom: 10px; right: 20px;">
</div>

Note! Each person who clicks on the widget will have to choose from the list of all the project's target languages before contributing. If you want to skip this step – predefine the target language at the beginning, by adding the language code to the snippet. Please remember, that people will still be able to change the language in the widget settings.
Crowdin language codes
Here's how a part of the snippet with a predefined French target language looks like:

<div
  id="crowdjet-container"
  data-project-id="243092"
  data-language-code="fr"
  style="bottom: 90px; right: 20px;">
</div>

Part of

@hangy
Copy link
Member

hangy commented Sep 5, 2021

Crowdin Docs: https://support.crowdin.com/in-context-localization/

This needs to be embedded in the lol language code (only?), because the in-context translation works using the crwdns164862:0crwdne164862:0 meta language values. Therefore, this is probably blocked by #667?

I think this updated syntax replaces #1738 and #2421.

@stephanegigandet
Copy link
Contributor

The easiest would be to symlink an unused 2 language code (e.g. "ll") to "lol". I'm testing it on the dev server. There will be some issues to resolve though, first one I noticed is that $file_timestamps{'css/dist/app-' . lang('text_direction') . '.css'}; doesn't work at all if we have a crowdin identifier for lang('text_direction')

@teolemon teolemon changed the title Enable translations for logged in users/moderators Enable in-line Crowdin translations for logged in users/moderators Sep 20, 2021
@teolemon teolemon added the Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org label Sep 20, 2021
@teolemon
Copy link
Member Author

@raphael0202 makes the point (probably valid) that we should disable the basic widget (not the inline thing which is not implemented yet) for non logged-in users.

Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jan 21, 2024
@teolemon teolemon added the ✨ Feature Features or enhancements to Open Food Facts server label Apr 1, 2024
@teolemon teolemon removed the ✨ Feature Features or enhancements to Open Food Facts server label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 P1 ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ✅ Task Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org
Projects
Status: Ready for Dev
Development

No branches or pull requests

3 participants