switch default locale to ru

27 views
Skip to first unread message

Kirill Maslinsky

unread,
Nov 17, 2020, 3:33:42 AM11/17/20
to NoSketch Engine

Hi all,

We added Russian localization to the NoSke web interface (crystal-open),
and would like to have Russian as a default language on our site.

I've tried to switch default language to "ru" in
app/src/core/Meta/Localization.meta.js

@@ -1,5 +1,5 @@
const LocalizationMeta = {
- default: "en",
+ default: "ru",
langs: [{

But to no avail. What is the right way to do this?

PS If anyone's interested, we are glad to share our localization files,
see http://git.altlinux.org/people/kirill/packages/crystal-open.git

--
KM

Tomáš Svoboda

unread,
Nov 18, 2020, 5:46:21 AM11/18/20
to NoSketch Engine, masl...@gmail.com
Hi Kirill,
you are doing it right, but unfortunately there is an bug:/ I will fix it, but due to certain circumstances it will take some time.

If you want to do it yourself, you just need to update two lines of code in Localization.js.


line 13:
-   en: require('locale/en.json')
+   [LocalizationMeta.default]: require(`locale/${LocalizationMeta.default}.json`)

line 18:
-   this._setLocale("en", this.resources.en)
+   this._setLocale(LocalizationMeta.default, this.resources[LocalizationMeta.default])

Dne úterý 17. listopadu 2020 v 9:33:42 UTC+1 uživatel masl...@gmail.com napsal:

Kirill Maslinsky

unread,
Nov 18, 2020, 2:31:50 PM11/18/20
to Tomáš Svoboda, NoSketch Engine

Thanks, Tomáš, everything worked with the patch you suggested.

BTW, here is a patch for another minor localization bug that I've
noticed on the way:

--- a/crystal-open/app/src/concordance/concordance-tabs.tag
+++ b/crystal-open/app/src/concordance/concordance-tabs.tag
@@ -36,7 +36,7 @@
}
this.tabs.push({
tabId: "about",
- label: "about",
+ labelId: "about",
tag: "concordance-tab-about"
})
--
KM

Tomáš Svoboda

unread,
Nov 19, 2020, 4:17:17 AM11/19/20
to NoSketch Engine, masl...@gmail.com
Thank you, I will fix it. (I am sure there will be few more bugs like this one:) )


Have a great day!

Tomas

Dne středa 18. listopadu 2020 v 20:31:50 UTC+1 uživatel masl...@gmail.com napsal:
Reply all
Reply to author
Forward
0 new messages