Skip to content

Commit

Permalink
Merge pull request #9598 from CitizenLabDotCo/TAN-3167-add-lithuanian
Browse files Browse the repository at this point in the history
TAN-3167: Add Lithuanian
  • Loading branch information
EdwinKato authored Dec 4, 2024
2 parents 230a071 + 1d52452 commit 85868da
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
Empty file.
1 change: 1 addition & 0 deletions back/config/initializers/0_locales.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
it-IT
kl-GL
lb-LU
lt-LT
lv-LV
mi
nb-NO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module NLPCloudHelpers
'it-IT' => 'ita_Latn',
'kl-GL' => nil, # Kalaallisut (Greenland) is not present
'lb-LU' => 'ltz_Latn',
'lt-LT' => 'lit_Latn',
'lv-LV' => 'lav_Latn',
'mi' => nil, # Maori is not present
'nb-NO' => 'nob_Latn',
Expand Down
5 changes: 5 additions & 0 deletions front/app/containers/App/constants-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ exports.locales = [
'hu-HU',
'it-IT',
'kl-GL',
'lt-LT',
'lb-LU',
'lv-LV',
'mi',
Expand Down Expand Up @@ -99,6 +100,7 @@ exports.appLocalePairs = {
'it-IT': 'Italiano',
'kl-GL': 'Kalaallisut',
'lb-LU': 'Lëtzebuergesch',
'lt-LT': 'Lietuvių',
'lv-LV': 'Latviešu',
mi: 'Māori',
'nb-NO': 'Norsk (Bokmål)',
Expand Down Expand Up @@ -141,6 +143,7 @@ exports.appGraphqlLocalePairs = {
itIt: 'it-IT',
klGl: 'kl-GL',
lbLu: 'lb-LU',
ltLT: 'lt',
lvLv: 'lv-LV',
mi: 'mi',
nb: 'nb',
Expand Down Expand Up @@ -180,6 +183,7 @@ exports.shortenedAppLocalePairs = {
'it-IT': 'Italiano',
'kl-GL': 'Kalaallisut',
'lb-LU': 'Lëtzebuergesch',
'lt-LT': 'Lietuvių',
'lv-LV': 'Latviešu',
mi: 'Māori',
'nb-NO': 'Norsk',
Expand Down Expand Up @@ -217,6 +221,7 @@ exports.appLocalesMomentPairs = {
'it-IT': 'it',
'kl-GL': 'da',
'lb-LU': 'lb',
'lt-LT': 'lt',
'lv-LV': 'lv',
mi: 'mi',
'nb-NO': 'nb',
Expand Down
5 changes: 5 additions & 0 deletions front/app/containers/App/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const locales = [
'hu-HU',
'it-IT',
'kl-GL',
'lt-LT',
'lb-LU',
'lv-LV',
'mi',
Expand Down Expand Up @@ -85,6 +86,7 @@ export const appLocalePairs = {
'it-IT': 'Italiano',
'kl-GL': 'Kalaallisut',
'lb-LU': 'Lëtzebuergesch',
'lt-LT': 'Lietuvių',
'lv-LV': 'Latviešu',
mi: 'Māori',
'nb-NO': 'Norsk (Bokmål)',
Expand Down Expand Up @@ -128,6 +130,7 @@ export const appGraphqlLocalePairs = {
itIt: 'it-IT',
klGl: 'kl-GL',
lbLu: 'lb-LU',
ltLt: 'lt',
lvLv: 'lv-LV',
mi: 'mi',
nb: 'nb',
Expand Down Expand Up @@ -168,6 +171,7 @@ export const shortenedAppLocalePairs = {
'it-IT': 'Italiano',
'kl-GL': 'Kalaallisut',
'lb-LU': 'Lëtzebuergesch',
'lt-LT': 'Lietuvių',
'lv-LV': 'Latviešu',
mi: 'Māori',
'nb-NO': 'Norsk',
Expand Down Expand Up @@ -206,6 +210,7 @@ export const appLocalesMomentPairs = {
'it-IT': 'it',
'kl-GL': 'da',
'lb-LU': 'lb',
'lt-LT': 'Lietuvių',
'lv-LV': 'lv',
mi: 'mi',
'nb-NO': 'nb',
Expand Down
17 changes: 17 additions & 0 deletions front/app/i18n/lt-LT.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import ltLT from 'date-fns/locale/lt';
import { registerLocale } from 'react-datepicker';

import { addLocale } from 'components/admin/DatePickers/_shared/locales';

import { formatTranslationMessages } from '.';

registerLocale('lt-LT', ltLT);
addLocale('lt-LT', ltLT);
const ltAdminTranslationMessages = require('translations/admin/lt-LT.json');
const ltTranslationMessages = require('translations/lt-LT.json');
const translationMessages = formatTranslationMessages('lt-LT', {
...ltTranslationMessages,
...ltAdminTranslationMessages,
});

export default translationMessages;

0 comments on commit 85868da

Please sign in to comment.