mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-05 20:43:57 +03:00
refactor: get localisation file
This commit is contained in:
parent
4e946879a2
commit
962cec0875
3 changed files with 11 additions and 3 deletions
|
@ -44,4 +44,8 @@ function localesProcess(reRender) {
|
||||||
if (reRender) reRenderPage();
|
if (reRender) reRenderPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
export { printDate, reRenderPage, localesProcess };
|
async function getNetLocale(lang, fileName) {
|
||||||
|
return (await (await fetch(`localisation/${lang}/${fileName}`)).text()) || "";
|
||||||
|
}
|
||||||
|
|
||||||
|
export { printDate, reRenderPage, localesProcess, getNetLocale };
|
||||||
|
|
|
@ -15,8 +15,10 @@
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { getNetLocale } from "../components/utils";
|
||||||
|
|
||||||
let en = {
|
let en = {
|
||||||
about_md: (await (await fetch("localisation/en/about.md")).text()) || "",
|
about_md: await getNetLocale("en", "about.md"),
|
||||||
Notes: "Notes",
|
Notes: "Notes",
|
||||||
Write: "Write",
|
Write: "Write",
|
||||||
Chat: "Chat",
|
Chat: "Chat",
|
||||||
|
|
|
@ -15,8 +15,10 @@
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { getNetLocale } from "../components/utils";
|
||||||
|
|
||||||
let ru = {
|
let ru = {
|
||||||
about_md: (await (await fetch("localisation/ru/about.md")).text()) || "",
|
about_md: await getNetLocale("ru", "about.md"),
|
||||||
Notes: "Заметки",
|
Notes: "Заметки",
|
||||||
Write: "Написать",
|
Write: "Написать",
|
||||||
Chat: "Чат",
|
Chat: "Чат",
|
||||||
|
|
Loading…
Reference in a new issue