Open biodivAtlasAT opened 2 years ago
Hello,
yes I think so! If the default value is the english descriptive name it will be easier to match the descriptive names of the other languages and we wouldn’t have to match them over the numbers.
Do you agree?
best regards Georg
Von: QBai @.> Gesendet: Montag, 1. November 2021 04:34 An: AtlasOfLivingAustralia/spatial-hub @.> Cc: Georg Neubauer @.>; Author @.> Betreff: Re: [AtlasOfLivingAustralia/spatial-hub] menu-config internationalization (PR #428)
@qifeng-bai commented on this pull request.
In grails-app/assets/javascripts/spApp/service/toolAddFacetService.jshttps://github.com/AtlasOfLivingAustralia/spatial-hub/pull/428#discussion_r739937672:
@@ -25,22 +25,22 @@
}
},
{
"description": "Species options.",
"description": $i18n(411),
Shall we use a default value, like: $i18n(411, "Species options."). It would give developers a direct hint : it is "Species options."
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AtlasOfLivingAustralia/spatial-hub/pull/428#pullrequestreview-793828754, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANPMCUG4CHJD3EDKLFYKFHLUJYDC7ANCNFSM5G2X72IQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
o! If the default value is the english descriptive name it will be easier to match the descriptive names of the other languages and we wouldn’t have to match them over the numbers.
Yes, we agree.
At this moment, we use both ways, since historically grails i18n pipeline plugin automatically generates i18n key-value pair by using number as key.
Please check our latest commits (i18n) in our dev branch. What we changed:
Add a new function $i18n = function (k, v) in spApp.js . Add a new parameter v, if cannot find key in i18n properties, use V as default. - also, it can be a hint when the key is a number. for example :
$i18n(411, "Species options.").
if 411 cannot be found, use "Species options."
In menuService.js, we merged your code for dynamic menu with small changes -> using name as key, not your i18nNr
In message.properties, we added few examples of 'descriptive names' as key
Add\ to\ map=Add to map
we also support $i18n("Add to map")
If 'Add to map' cannot be found in message.properties, it will use 'Add to map' as value
Cheers
Hello,
that sounds perfect! thanks for the task!
Cheers
Von: QBai @.> Gesendet: Mittwoch, 3. November 2021 01:11 An: AtlasOfLivingAustralia/spatial-hub @.> Cc: Georg Neubauer @.>; Author @.> Betreff: Re: [AtlasOfLivingAustralia/spatial-hub] menu-config internationalization (PR #428)
o! If the default value is the english descriptive name it will be easier to match the descriptive names of the other languages and we wouldn’t have to match them over the numbers.
Yes, we agree.
At this moment, we use both ways, since historically grails i18n pipeline plugin automatically generates i18n key-value pair by using number as key.
Please check our latest commits (i18n) in our dev branch. What we changed:
Add a new function $i18n = function (k, v) in spApp.js . Add a new parameter v, if cannot find key in i18n properties, use V as default. - also, it can be a hit when the key is a number. for example : $i18n(411, "Species options.").
In menuService.js, we merged your code for dynamic menu with small changes -> using name as key, not your i18nNr
In message.properties, we added few examples of 'descriptive names' as key Add\ to\ map=Add to map
Cheers
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AtlasOfLivingAustralia/spatial-hub/pull/428#issuecomment-958488050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANPMCUFWAFNXZV4BQVUVY2DUKB43LANCNFSM5G2X72IQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I saw run.cmd has been fixed. Shall we only cherry-pick internationalisation part or merge all? @vjrj
Sincerely, I still see a mix of things here, and I see difficult to cherry-pick, but it's my impression. Also other minor things should be addressed like:
Thanks, @vjrj . I will follow up it after I finish my current tasks
Dear community,
I tried to do internationalization to the menu-config.json by adding i18nNr variable refering to the message.properties numbers of spatial-hub
I changed menuServcie.js when menu data is loaded to:
if ($SH.menu.indexOf('http') == 0) { var setup = $http.get($SH.menu, _httpDescription('getMenu')).then(function (data) { var it_0 = 0; var it_1 = 0; for(it_0 = 0; it_0 < data.data.length; it_0++) { data.data[it_0].name = $i18n(data.data[it_0].i18nNr); for(it_1 = 0; it_1 < data.data[it_0].items.length; it_1++) { data.data[it_0].items[it_1].name = $i18n(data.data[it_0].items[it_1].i18nNr); } } menuConfig = data.data; return menuConfig; }); } else { menuConfig = $SH.menu; setup = $q.when(menuConfig) }
Excuse me, but there are other unneeded changes in this too - I applied a window.getCookie('lang') for switching language all over the atlas which won't be needed by all of us
We added the String names of the menu-config.json file into our message.properties within incemented numbers
best regards Georg Neubauer