Skip to content

Commit

Permalink
feat: Languages with country codes
Browse files Browse the repository at this point in the history
  • Loading branch information
meltyshev committed Jul 21, 2024
1 parent e9b4a4a commit 9dc3893
Show file tree
Hide file tree
Showing 83 changed files with 211 additions and 99 deletions.
24 changes: 12 additions & 12 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"dequal": "^2.0.3",
"easymde": "^2.18.0",
"history": "^5.3.0",
"i18next": "^23.11.5",
"i18next": "^23.12.2",
"i18next-browser-languagedetector": "^8.0.0",
"initials": "^3.1.2",
"js-cookie": "^3.0.5",
Expand All @@ -83,7 +83,7 @@
"react-datepicker": "^4.25.0",
"react-dom": "^18.2.0",
"react-dropzone": "^14.2.3",
"react-i18next": "^14.1.2",
"react-i18next": "^15.0.0",
"react-input-mask": "^2.0.4",
"react-markdown": "^8.0.7",
"react-photoswipe-gallery": "^2.2.7",
Expand Down
6 changes: 3 additions & 3 deletions client/src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ i18n
.use(initReactI18next)
.init({
resources: embeddedLocales,
fallbackLng: 'en',
fallbackLng: 'en-US',
supportedLngs: languages,
load: 'languageOnly',
load: 'currentOnly',
interpolation: {
escapeValue: false,
format(value, format, language) {
Expand All @@ -80,7 +80,7 @@ i18n
});

i18n.loadCoreLocale = async (language = i18n.resolvedLanguage) => {
if (language === 'en') {
if (language === i18n.options.fallbackLng[0]) {
return;
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'bg',
language: 'bg-BG',
country: 'bg',
name: 'Български',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'cs',
language: 'cs-CZ',
country: 'cz',
name: 'Čeština',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'da',
language: 'da-DK',
country: 'dk',
name: 'Dansk',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'de',
language: 'de-DE',
country: 'de',
name: 'Deutsch',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import login from './login';
import core from './core';

export default {
language: 'en',
country: 'gb',
language: 'en-US',
country: 'us',
name: 'English',
embeddedLocale: merge(login, core),
};
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'es',
language: 'es-ES',
country: 'es',
name: 'Español',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'fa',
language: 'fa-IR',
country: 'ir',
name: 'فارسی',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'fr',
language: 'fr-FR',
country: 'fr',
name: 'Français',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'hu',
language: 'hu-HU',
country: 'hu',
name: 'Magyar',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'id',
language: 'id-ID',
country: 'id',
name: 'Bahasa Indonesia',
embeddedLocale: login,
Expand Down
File renamed without changes.
96 changes: 48 additions & 48 deletions client/src/locales/index.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
import bg from './bg';
import cs from './cs';
import da from './da';
import de from './de';
import en from './en';
import es from './es';
import fa from './fa';
import fr from './fr';
import hu from './hu';
import id from './id';
import it from './it';
import ja from './ja';
import ko from './ko';
import nl from './nl';
import pl from './pl';
import pt from './pt';
import ro from './ro';
import ru from './ru';
import sk from './sk';
import sv from './sv';
import tr from './tr';
import ua from './ua';
import uz from './uz';
import zh from './zh';
import bgBG from './bg-BG';
import csCZ from './cs-CZ';
import daDK from './da-DK';
import deDE from './de-DE';
import enUS from './en-US';
import esES from './es-ES';
import faIR from './fa-IR';
import frFR from './fr-FR';
import huHU from './hu-HU';
import idID from './id-ID';
import itIT from './it-IT';
import jaJP from './ja-JP';
import koKR from './ko-KR';
import nlNL from './nl-NL';
import plPL from './pl-PL';
import ptBR from './pt-BR';
import roRO from './ro-RO';
import ruRU from './ru-RU';
import skSK from './sk-SK';
import svSE from './sv-SE';
import trTR from './tr-TR';
import ukUA from './uk-UA';
import uzUZ from './uz-UZ';
import zhCN from './zh-CN';

const locales = [
bg,
cs,
da,
de,
en,
es,
fa,
fr,
hu,
id,
it,
ja,
ko,
nl,
pl,
pt,
ro,
ru,
sk,
sv,
tr,
ua,
uz,
zh,
bgBG,
csCZ,
daDK,
deDE,
enUS,
esES,
faIR,
frFR,
huHU,
idID,
itIT,
jaJP,
koKR,
nlNL,
plPL,
ptBR,
roRO,
ruRU,
skSK,
svSE,
trTR,
ukUA,
uzUZ,
zhCN,
];

export default locales;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import dateFns from 'date-fns/locale/it';

export default {
dateFns,

format: {
date: 'd/M/yyyy',
time: 'p',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'it',
language: 'it-IT',
country: 'it',
name: 'Italiano',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'ja',
language: 'ja-JP',
country: 'jp',
name: '日本語',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'ko',
language: 'ko-KR',
country: 'kr',
name: '한국어',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'nl',
language: 'nl-NL',
country: 'nl',
name: 'Nederlands',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'pl',
language: 'pl-PL',
country: 'pl',
name: 'Polski',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'pt',
language: 'pt-BR',
country: 'br',
name: 'Português',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'ro',
language: 'ro-RO',
country: 'ro',
name: 'Română',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'ru',
language: 'ru-RU',
country: 'ru',
name: 'Русский',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'sk',
language: 'sk-SK',
country: 'sk',
name: 'Slovenčina',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import login from './login';

export default {
language: 'sv',
language: 'sv-SE',
country: 'se',
name: 'Svenska',
embeddedLocale: login,
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9dc3893

Please sign in to comment.