Skip to content

Commit

Permalink
Menambah terjemahan embed bahasa Melayu (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
niskala5570 authored Jul 26, 2024
1 parent 776cf65 commit 5e4b1a0
Show file tree
Hide file tree
Showing 4 changed files with 523 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/SettingsPage/EmbedGen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ class EmbedGenSettings extends React.Component<EmbedGenProps, EmbedGenState> {
su: "Sunda",
jv: "Jawa",
jp: "日本語",
ms: "Bahasa Melayu",
ms_Arab: "بهاس ملايو",
};

// eslint-disable-next-line @typescript-eslint/no-this-alias
Expand Down
8 changes: 7 additions & 1 deletion i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Locale as LocaleEN, TimeAgoLocale as TimeAgoLocaleEN } from "./en";
import { Locale as LocaleSU, TimeAgoLocale as TimeAgoLocaleSU } from "./su";
import { Locale as LocaleJV, TimeAgoLocale as TimeAgoLocaleJV } from "./jv";
import { Locale as LocaleJP, TimeAgoLocale as TimeAgoLocaleJP } from "./jp";
import { Locale as LocaleMS, TimeAgoLocale as TimeAgoLocaleMS } from "./ms";
import { Locale as LocaleMSArab, TimeAgoLocale as TimeAgoLocaleMSArab } from "./ms_Arab";
import { isNone } from "../lib/utils";

export const LocaleMap = {
Expand All @@ -14,6 +16,8 @@ export const LocaleMap = {
su: LocaleSU,
jv: LocaleJV,
jp: LocaleJP,
ms: LocaleMS,
ms_Arab: LocaleMSArab,
};

export const ValidLocale = Object.keys(LocaleMap);
Expand All @@ -24,6 +28,8 @@ const TimeAgoLocaleExtra = [
TimeAgoLocaleJP,
TimeAgoLocaleJV,
TimeAgoLocaleSU,
TimeAgoLocaleMS,
TimeAgoLocaleMSArab,
];
TimeAgoLocaleExtra.forEach((locale) => {
// @ts-ignore
Expand All @@ -34,7 +40,7 @@ TimeAgo.setDefaultLocale("id");

export type Locale = keyof typeof LocaleMap;
// Add new TimeAgo language code here.
export type TimeAgoLocale = "id" | "en" | "jv" | "su" | "ja" | "jp";
export type TimeAgoLocale = "id" | "en" | "jv" | "su" | "ja" | "jp" | "ms" | "ms_Arab";

function walkKey(data: any, notations: string) {
const splitNots = notations.split(".");
Expand Down
257 changes: 257 additions & 0 deletions i18n/ms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
/**
* Malay localization
* Created by niskala <niskala5570@gmail.com>
* Based on Indonesian localization
* Created: 25 July 2024
* Last Update: 25 July 2024
*
* (C) 2024 naoTimes Dev
* MIT License
*/

import { ExtendedLocale } from "./_types";

const TimeAgoLocale: ExtendedLocale = {
locale: "ms",
long: {
year: {
previous: "tahun lepas",
current: "tahun ini",
next: "tahun depan",
past: "{0} tahun yang lepas",
future: "dalam {0} tahun",
},
quarter: {
previous: "Suku tahun lepas",
current: "suku tahun ini",
next: "suku tahun berikutnya",
past: "{0} suku tahun yang lepas",
future: "dalam {0} suku tahun",
},
month: {
previous: "bulan lepas",
current: "bulan ini",
next: "bulan berikutnya",
past: "{0} bulan yang lepas",
future: "dalam {0} bulan",
},
week: {
previous: "minggu lepas",
current: "minggu ini",
next: "minggu depan",
past: "{0} minggu yang lepas",
future: "dalam {0} minggu",
},
day: {
previous: {
one: "semalam",
two: "kelmarin",
other: "semalam",
},
current: "hari ini",
next: {
one: "esok",
two: "lusa",
other: "esok",
},
past: "{0} hari yang lepas",
future: "dalam {0} hari",
},
hour: {
current: "sejam lagi",
past: "{0} jam yang lepas",
future: "dalam {0} jam",
},
minute: {
current: "seminit lagi",
past: "{0} minit yang lepas",
future: "dalam {0} minit",
},
second: {
current: "sekarang",
past: "{0} saat yang lepas",
future: "dalam {0} saat",
},
},
short: {
year: {
previous: "tahun lepas",
current: "tahun ini",
next: "tahun depan",
past: "{0} thn lepas",
future: "dlm {0} thn",
},
quarter: {
previous: "Suku tahun lepas",
current: "suku tahun ini",
next: "suku tahun berikutnya",
past: "{0} suku thn. lepas",
future: "dlm {0} suku thn.",
},
month: {
previous: "bulan lepas",
current: "bulan ini",
next: "bulan berikutnya",
past: "{0} bln lepas",
future: "dlm {0} bln",
},
week: {
previous: "minggu lepas",
current: "minggu ini",
next: "minggu depan",
past: "{0} mgg lepas",
future: "dlm {0} mgg",
},
day: {
previous: {
one: "semalam",
two: "kelmarin",
other: "semalam",
},
current: "hari ini",
next: {
one: "esok",
two: "lusa",
other: "esok",
},
past: "{0} h lepas",
future: "dalam {0} h",
},
hour: {
current: "sejam lg",
past: "{0} jam lepas",
future: "dalam {0} jam",
},
minute: {
current: "1 mnt lg",
past: "{0} mnt lepas",
future: "dlm {0} mnt",
},
second: {
current: "sekarang",
past: "{0} saat lepas",
future: "dlm {0} saat",
},
},
narrow: {
year: {
previous: "tahun lepas",
current: "tahun ini",
next: "tahun depan",
past: "{0} thn lepas",
future: "dlm {0} thn",
},
quarter: {
previous: "Suku tahun lepas",
current: "suku tahun ini",
next: "suku tahun berikutnya",
past: "{0} suku thn. lepas",
future: "dlm {0} suku thn.",
},
month: {
previous: "bulan lepas",
current: "bulan ini",
next: "bulan berikutnya",
past: "{0} bln lepas",
future: "dlm {0} bln",
},
week: {
previous: "minggu lepas",
current: "minggu ini",
next: "minggu depan",
past: "{0} mgg lepas",
future: "dlm {0} mgg",
},
day: {
previous: "kelmarin",
current: "hari ini",
next: "esok",
past: "{0} h lepas",
future: "dalam {0} h",
},
hour: {
current: "sejam lagi",
past: "{0} jam lepas",
future: "dalam {0} jam",
},
minute: {
current: "1 mnt lg",
past: "{0} mnt lepas",
future: "dlm {0} mnt",
},
second: {
current: "sekarang",
past: "{0} saat lepas",
future: "dlm {0} saat",
},
},
now: {
now: {
current: "sekarang",
future: "beberapa saat lagi",
past: "baru saja",
},
},
mini: {
year: "{0}thn",
month: "{0}bln",
week: "{0}mg",
day: "{0}hr",
hour: "{0}jam",
minute: "{0}mnt",
second: "{0}saat",
now: "sekarang",
},
"short-time": {
year: "{0} thn.",
month: "{0} bln.",
week: "{0} mg.",
day: "{0} hr.",
hour: "{0} jam.",
minute: "{0} mnt.",
second: "{0} saat.",
},
"long-time": {
year: "{0} tahun",
month: "{0} bulan",
week: "{0} minggu",
day: "{0} hari",
hour: "{0} jam",
minute: "{0} minit",
second: "{0} saat",
},
// Default quantify from the module.
quantify: (_n) => "other",
};

const Locale = {
ROLES: {
TL: "Terjemahan",
TLC: "Semak Terjemahan",
ENC: "Pengekod Video",
ED: "Editor Skrip",
TM: "Pelaras Waktu",
TS: "Penata Huruf",
QC: "Tinjauan Akhir",
},
NO_PROGRESS: "Belum ada kemajuan",
AIRED: "Tayang {0}", // (Tayang) xx hari lepas
AIRING: "Tayang {0}", // (Tayang) dalam xx hari lepas
SEASON: {
WINTER: "Musim Sejuk {0}",
SPRING: "Musim Bunga {0}",
SUMMER: "Musim Panas {0}",
FALL: "Musim Luruh {0}",
},
DROPDOWN: {
// {{episode}} will be substitued with remaining episode
EXPAND: "Lihat {0} episode selanjutnya...",
RETRACT: "Tutup...",
},
LAST_UPDATE: "Diperbaharui {0}",
EPISODE_NEEDS: "perlu",
WAITING_RELEASE: "Menunggu diterbit...",
COLLAB_WITH: "Dengan kerjasama {0}",
};

export { Locale, TimeAgoLocale };
Loading

0 comments on commit 5e4b1a0

Please sign in to comment.