Skip to content

Commit

Permalink
use weblate locales for ui
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Nov 19, 2024
1 parent ac20ff1 commit 1f0ea59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/mixins/localizeMoment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export default {
* This only maps the locales that need to be translated.
* Most PKP locales work fine in Moment.js.
*
* @param {String} locale The PKP locale, eg - `sr_RS@cyrillic`
* @param {String} locale The PKP locale, eg - `sr_Cyrl`
*/
getMomentLocale(locale) {
const map = {
'sr_RS@latin': 'sr',
'sr_RS@cyrillic': 'sr-cyrl',
'uz_UZ@latin': 'uz-latn',
sr_Latn: 'sr',
sr_Cyrl: 'sr-cyrl',
uz_Latn: 'uz-latn',
};

return map[locale] ?? locale;
Expand Down
22 changes: 0 additions & 22 deletions src/pages/dashboard/mocks/pageInitConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,6 @@ export default {
_extractionAdaptersLoaded: false,
_metadataInjectionAdapters: [],
_injectionAdaptersLoaded: false,
_localesTable: {
'be@cyrillic': 'be',
bs: 'bs_Latn',
fr_FR: 'fr',
nb: 'nb_NO',
'sr@cyrillic': 'sr_Cyrl',
'sr@latin': 'sr_Latn',
'uz@cyrillic': 'uz',
'uz@latin': 'uz_Latn',
zh_CN: 'zh_Hans',
},
},
2: {
_data: {
Expand Down Expand Up @@ -475,17 +464,6 @@ export default {
_extractionAdaptersLoaded: false,
_metadataInjectionAdapters: [],
_injectionAdaptersLoaded: false,
_localesTable: {
'be@cyrillic': 'be',
bs: 'bs_Latn',
fr_FR: 'fr',
nb: 'nb_NO',
'sr@cyrillic': 'sr_Cyrl',
'sr@latin': 'sr_Latn',
'uz@cyrillic': 'uz',
'uz@latin': 'uz_Latn',
zh_CN: 'zh_Hans',
},
},
},
publicationTitleAbstractForm: {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ export function localizeSubmission(localizedString, submissionLocale) {
* This only maps the locales that need to be translated.
* Most PKP locales work fine in Moment.js.
*
* @param {String} locale The PKP locale, eg - `sr_RS@cyrillic`
* @param {String} locale The PKP locale, eg - `sr_Cyrl`
*/
export function getMomentLocale(locale) {
const map = {
'sr_RS@latin': 'sr',
'sr_RS@cyrillic': 'sr-cyrl',
'uz_UZ@latin': 'uz-latn',
sr_Latn: 'sr',
sr_Cyrl: 'sr-cyrl',
uz_Latn: 'uz-latn',
};

return map[locale] ?? locale;
Expand Down

0 comments on commit 1f0ea59

Please sign in to comment.