Commit Graph

30 Commits

Author SHA1 Message Date
Martin Raifer
4bef27db82 add to changelog, mark t.html as deprecated 2021-11-30 10:33:55 +01:00
Martin Raifer
9f3f8e1366 rename method 2021-11-29 19:26:18 +01:00
Martin Raifer
d78c357588 replace raw html injection of localized texts
by using d3 to insert the localized text spans directly into the DOM
2021-11-26 18:51:45 +01:00
Martin Raifer
8bbae82caa localizer: escape placeholder replacement values in html output mode 2021-11-18 13:09:16 +01:00
Minh Nguyễn
3f09ebee59 Corrected language code for undefined language 2021-11-17 18:17:24 -08:00
Bryan Housel
bb84962e5d Only insert sources into the fileMap if not already there
This allows us to setup the fileMap correctly for testing so
that it never tries to fetch assets from the CDN.
2021-08-16 13:28:55 -04:00
Quincy Morgan
9423f61adf Improve some variable names in core/localizer 2021-02-23 11:50:42 -05:00
Quincy Morgan
d0754a9256 Trim whitespace from localized string ids 2021-02-15 11:09:26 -05:00
Quincy Morgan
6f66032237 Fix issue with replacing number tokens in strings when toLocaleString is unavailable, such as when running tests (re: #8276) 2021-02-15 10:59:44 -05:00
Quincy Morgan
cb7f1c2b3c Update to id-tagging-schema v3.0.0
Add UI for translatable combo fields
2020-12-08 15:23:51 -05:00
Quincy Morgan
102fe6277c Add checks for calling coreLocalizer.tInfo before loading strings 2020-12-02 10:10:20 -05:00
Quincy Morgan
7666f927b5 Fix an issue with fallback preset strings 2020-12-01 11:45:02 -05:00
Quincy Morgan
baabd81987 Unbundle id-tagging-schema data and translations
Update for id-tagging-schema 2.0.0
2020-12-01 11:14:14 -05:00
Quincy Morgan
04b3a788f9 Add lint:fix script
Enable no-trailing-space eslint rule
2020-10-23 13:24:44 -04:00
Peter Newman
3919ec11b6 Fix a new typo which snuck in 2020-10-05 23:23:16 +01:00
Quincy Morgan
03c32d2f6a Return empty string instead of empty html element for empty text 2020-09-28 15:36:01 -04:00
Quincy Morgan
bbbf401232 Add en fallback in coreLocalizer instead of utilDetect.browserLocales
Include all preferred and fallback langauges in coreLocalizer.localeCodes even if higher-priority ones have 100% string coverage
Fallback to the user's preferred languages instead of directly to English when querying OSM wikibase documentation and Wikidata (re: #7996)
Add `lang` attribute to tag documentation text loaded from OSM wikibase or Wikidata (re: #7963)
2020-09-23 16:15:34 -04:00
Quincy Morgan
8883c2f36d Fix uiFlash issues
Clean up a few things from prior commit
2020-09-22 12:19:54 -04:00
Quincy Morgan
5435082d9c Revert t function to returning the plain string by default
Add `t.html` function for getting the string with the `lang` attribute
2020-09-22 12:03:29 -04:00
Quincy Morgan
32f8274929 Make t function return a span element with a lang attribute unless html: false is specified in the options (re: #7963)
Update `text` functions to `html` to support inserting the `span` elements
Specify `html: false` for various instances where a `span` is not desired, e.g. `placeholder` and `title` attributes
2020-09-15 21:56:22 -04:00
Quincy Morgan
7aa6c1d1a3 Fix infinite recursion error for en-US 2020-09-15 18:27:26 -04:00
Quincy Morgan
a9979f6534 Fallback to the user's preferred locales instead of immediately to English (close #7996) 2020-09-15 17:56:13 -04:00
Quincy Morgan
7ab9f268d9 Don't fetch the English strings if the preferred locale has 100% coverage (close #7994) 2020-09-15 16:09:08 -04:00
Quincy Morgan
8ecada3b79 Move languageNames and scriptNames data to the individual locale files instead of always loading them via locales.json (re: #7994) 2020-09-15 14:41:56 -04:00
Quincy Morgan
f28d41b44e Localize the format of numbers in translated strings (close #7993) 2020-09-15 11:34:56 -04:00
Quincy Morgan
a1c2b7f73d Support language-specific pluralization (re: #597, #4964) 2020-09-14 17:21:00 -04:00
Peter Newman
4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01:00
Quincy Morgan
c2065dbd27 Re-add endpoint to set the preferred locale code programmatically 2020-07-20 15:58:47 -04:00
Quincy Morgan
36236d776b Use metric by default for non-english locales with US country 2020-07-20 11:34:39 -04:00
Quincy Morgan
a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00