question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Intl.RelativeTimeFormat` is not displaying correctly for Crowdin server's special `ach-ug` locale

See original GitHub issue

Observed behavior

After following up on the conversation in Slack, I see that the string that uses the standard Intl.RelativeTimeFormat is not displaying correctly in German:

crwdns278692:0crwdns278116:0crwdne278116:0crwdne278692:0 - Mozilla Firefox_820

switch to ‘German’ to see this on the in-context server

Expected behavior

Fully translated string.

User-facing consequences

Inability to understand.

Errors and logs

Steps to reproduce

#. Go to in-context server #. Switch language to ‘German’ #. Go to Facility > Data

Context

  • Kolibri version: 0.14.0b12
  • Operating system: all
  • Browser: all

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
rtibblescommented, May 20, 2021

@jonboiser I think the best way to do what you describe would be to add special detection logic here: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/assets/src/utils/i18n.js#L183 for the ach-ug language code.

If we detect that, we should then update currentLanguage to localStorage.jipt_language_code_kolibri and update languageDirection accordingly too.

By making that shift, it should register all the ach-ug messages as messages for that language instead, and then Kolibri and vue-intl should work seamlessly under the impression that it’s using that language, but using the in context translation messages.

0reactions
jonboisercommented, May 20, 2021

This works, but running things locally, I notice a lot of messages are not localized. But this was before I made any changes!

CleanShot 2021-05-20 at 11 34 40

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intl.RelativeTimeFormat does not correctly reflect the spec
Expected behavior: Actual behavior: Reading through the lib2020.intl.d.ts I noticed a couple of issues in the declarations: Locale should not be ...
Read more >
Intl.RelativeTimeFormat - JavaScript - MDN Web Docs - Mozilla
Returns an Array of objects representing the relative time format in parts that can be used for custom locale-aware formatting. Intl.RelativeTimeFormat.
Read more >
In-Context Localization Tool | Crowdin Blog
We allow to upload screenshots to show where the text segment is being used in real product, comment segments, create glossary to highlight...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found