For now all we have for JS is Drupal.t() and Drupal.formatPlural() which is nice but pretty basic.

We need to look at what we can do on the JS side to help with localizing JS strings and how that can fit with JS libraries that already have internationalization tools/processes. It might turn out we don't want to do much more than what we're currently doing, I don't know.

First we need to list all the problems/limitation of the current state of things then brainstorm ideas about how to address this.

Comments

Gábor Hojtsy’s picture

Drupal.t() and Drupal.formatPlural() although not very well known, are fantastic in that they map to their PHP equivalents basically 1-1 (except JS syntax obviously). I think there are certain values in there, that would be bad to loose unless we have very good reasons to do something else in JS. (Also, we put in tons of work to level the JS functionality with the Drupal PHP API side, adding context in D8 to JS strings too, so we invested quite a bit there already :).

nod_’s picture

Yes I agree, I'm not trying to undermine the work already done on the JS side of things.

I'm concerned when I see issues like this one (it's verbose and doesn't minify very well/at all) #507502: (needs documentation) Provide Locale support for jQuery UI. I'd like to fine a more elegant solution for it and maybe make it possible to integrate a bit more gracefully with the translations provided by the third party library or help third party script integrate with drupal translations. I'm not sure it has to be done but it needs to be discussed at least.

Gábor Hojtsy’s picture

Title: Internationalization of JS » Integrate JS internationalization with third party libraries

Yes, those sound like great goals. Retiling for that to reflect that we are not redoing the existing functionality.

nod_’s picture

Yep much better, thanks. That's what I had in mind, was putting the wrong words over it.

Gábor Hojtsy’s picture

Issue tags: +language-ui

Fix tag.

nod_’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

nod_’s picture

Version: 9.3.x-dev » 10.0.x-dev
Status: Active » Closed (won't fix)

Cleaning-up my issues