mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Refactored localization files.
This commit is contained in:
parent
7c2b687350
commit
f24696de5a
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
Loading…
Reference in New Issue
Block a user