Refactored localization files.

This commit is contained in:
Mike Cao 2022-03-18 19:17:23 -07:00
parent 7c2b687350
commit f24696de5a
124 changed files with 18 additions and 18 deletions

View File

@ -1,7 +1,7 @@
import { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
import { get } from 'lib/web';
import enUS from 'public/country/en-US.json';
import enUS from 'public/intl/country/en-US.json';
const countryNames = {
'en-US': enUS,
@ -12,7 +12,7 @@ export default function useCountryNames(locale) {
const { basePath } = useRouter();
async function loadData(locale) {
const { ok, data } = await get(`${basePath}/country/${locale}.json`);
const { ok, data } = await get(`${basePath}/intl/country/${locale}.json`);
if (ok) {
countryNames[locale] = data;

View File

@ -1,7 +1,7 @@
import { useState, useEffect } from 'react';
import { useRouter } from 'next/router';
import { get } from 'lib/web';
import enUS from 'public/language/en-US.json';
import enUS from 'public/intl/language/en-US.json';
const languageNames = {
'en-US': enUS,
@ -12,7 +12,7 @@ export default function useLanguageNames(locale) {
const { basePath } = useRouter();
async function loadData(locale) {
const { ok, data } = await get(`${basePath}/language/${locale}.json`);
const { ok, data } = await get(`${basePath}/intl/language/${locale}.json`);
if (ok) {
languageNames[locale] = data;

View File

@ -5,7 +5,7 @@ import { LOCALE_CONFIG } from 'lib/constants';
import { getDateLocale, getTextDirection } from 'lib/lang';
import useStore, { setLocale } from 'store/app';
import useForceUpdate from 'hooks/useForceUpdate';
import enUS from 'public/messages/en-US.json';
import enUS from 'public/intl/messages/en-US.json';
const messages = {
'en-US': enUS,
@ -21,7 +21,7 @@ export default function useLocale() {
const dateLocale = getDateLocale(locale);
async function loadMessages(locale) {
const { ok, data } = await get(`${basePath}/messages/${locale}.json`);
const { ok, data } = await get(`${basePath}/intl/messages/${locale}.json`);
if (ok) {
messages[locale] = data;

View File

@ -31,7 +31,7 @@
"extract-lang": "formatjs extract \"{pages,components}/**/*.js\" --out-file build/messages.json",
"merge-lang": "node scripts/merge-lang.js",
"format-lang": "node scripts/format-lang.js",
"compile-lang": "formatjs compile-folder --ast build public/messages",
"compile-lang": "formatjs compile-folder --ast build public/intl/messages",
"check-lang": "node scripts/check-lang.js",
"download-country-names": "node scripts/download-country-names.js",
"download-language-names": "node scripts/download-language-names.js",

Some files were not shown because too many files have changed in this diff Show More