mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-11-22 03:46:22 +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();
|
||||
}
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
import { getNetLocale } from "../components/utils";
|
||||
|
||||
let en = {
|
||||
about_md: (await (await fetch("localisation/en/about.md")).text()) || "",
|
||||
about_md: await getNetLocale("en", "about.md"),
|
||||
Notes: "Notes",
|
||||
Write: "Write",
|
||||
Chat: "Chat",
|
||||
|
|
|
@ -15,8 +15,10 @@
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { getNetLocale } from "../components/utils";
|
||||
|
||||
let ru = {
|
||||
about_md: (await (await fetch("localisation/ru/about.md")).text()) || "",
|
||||
about_md: await getNetLocale("ru", "about.md"),
|
||||
Notes: "Заметки",
|
||||
Write: "Написать",
|
||||
Chat: "Чат",
|
||||
|
|
Loading…
Add table
Reference in a new issue