mirror of
https://github.com/makeplane/plane.git
synced 2026-05-20 16:09:52 -05:00
[WEB-3545] feat: language translations (#6762)
* feat(translations): add Korean translation (#6755) * feat(translations): init Korean translation Co-authored-by: NavyStack <navystack@askfront.com> Co-authored-by: FVOCI <150913557+fvoci@users.noreply.github.com> * feat(translations): add rough Korean translation Co-authored-by: NavyStack <navystack@askfront.com> Co-authored-by: FVOCI <150913557+fvoci@users.noreply.github.com> --------- Co-authored-by: FVOCI <150913557+fvoci@users.noreply.github.com> * feat(translations): add Slovak, Deutsch, Ukrainian and Polish translation (#6743) * feat(translation): add Slovak translation * feat(translation): add Slovak translation for workspace * feat(translation): improved Slovak translation for views * feat(translation): add Deutsch translation * feat(translation): add Ukrainian translation * feat(translation): add Polish translation --------- Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> * fix: project cycle translations * fix: build error * feat: Add zh-TW Traditional Chinese locale (#6764) Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> * chore: zh-TW core translation updated --------- Co-authored-by: NavyStack <navystack@askfront.com> Co-authored-by: FVOCI <150913557+fvoci@users.noreply.github.com> Co-authored-by: Ján Regeš <jan.reges@gmail.com> Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com> Co-authored-by: Peter Dave Hello <hsu@peterdavehello.org>
This commit is contained in:
committed by
GitHub
parent
d4991b9a48
commit
e339b7ad8f
@@ -7,10 +7,16 @@ export const SUPPORTED_LANGUAGES: ILanguageOption[] = [
|
||||
{ label: "Français", value: "fr" },
|
||||
{ label: "Español", value: "es" },
|
||||
{ label: "日本語", value: "ja" },
|
||||
{ label: "中文", value: "zh-CN" },
|
||||
{ label: "简体中文", value: "zh-CN" },
|
||||
{ label: "繁體中文", value: "zh-TW" },
|
||||
{ label: "Русский", value: "ru" },
|
||||
{ label: "Italian", value: "it" },
|
||||
{ label: "Čeština", value: "cs" },
|
||||
{ label: "Slovenčina", value: "sk" },
|
||||
{ label: "Deutsch", value: "de" },
|
||||
{ label: "Українська", value: "ua" },
|
||||
{ label: "Polski", value: "pl" },
|
||||
{ label: "한국어", value: "ko" },
|
||||
];
|
||||
|
||||
export const STORAGE_KEY = "userLanguage";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useContext } from 'react';
|
||||
import { useContext } from "react";
|
||||
// context
|
||||
import { TranslationContext } from '../context';
|
||||
import { TranslationContext } from "../context";
|
||||
// types
|
||||
import { ILanguageOption, TLanguage } from '../types';
|
||||
import { ILanguageOption, TLanguage } from "../types";
|
||||
|
||||
export type TTranslationStore = {
|
||||
t: (key: string, params?: Record<string, any>) => string;
|
||||
@@ -23,7 +23,7 @@ export type TTranslationStore = {
|
||||
export function useTranslation(): TTranslationStore {
|
||||
const store = useContext(TranslationContext);
|
||||
if (!store) {
|
||||
throw new Error('useTranslation must be used within a TranslationProvider');
|
||||
throw new Error("useTranslation must be used within a TranslationProvider");
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"home": "Domov",
|
||||
"your_work": "Vaše práce",
|
||||
"inbox": "Doručená pošta",
|
||||
"workspace": "workspace",
|
||||
"workspace": "Pracovní prostor",
|
||||
"views": "Pohledy",
|
||||
"analytics": "Analytika",
|
||||
"work_items": "Pracovní položky",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -147,12 +147,24 @@ export class TranslationStore {
|
||||
return import("../locales/ja/translations.json");
|
||||
case "zh-CN":
|
||||
return import("../locales/zh-CN/translations.json");
|
||||
case "zh-TW":
|
||||
return import("../locales/zh-TW/translations.json");
|
||||
case "ru":
|
||||
return import("../locales/ru/translations.json");
|
||||
case "it":
|
||||
return import("../locales/it/translations.json");
|
||||
case "cs":
|
||||
return import("../locales/cs/translations.json");
|
||||
case "sk":
|
||||
return import("../locales/sk/translations.json");
|
||||
case "de":
|
||||
return import("../locales/de/translations.json");
|
||||
case "ua":
|
||||
return import("../locales/ua/translations.json");
|
||||
case "pl":
|
||||
return import("../locales/pl/translations.json");
|
||||
case "ko":
|
||||
return import("../locales/ko/translations.json");
|
||||
default:
|
||||
throw new Error(`Unsupported language: ${language}`);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export type TLanguage = "en" | "fr" | "es" | "ja" | "zh-CN" | "ru" | "it" | "cs";
|
||||
export type TLanguage = "en" | "fr" | "es" | "ja" | "zh-CN" | "zh-TW" | "ru" | "it" | "cs" | "sk" | "de" | "ua" | "pl" | "ko";
|
||||
|
||||
export interface ILanguageOption {
|
||||
label: string;
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ const ProjectCyclesPage = observer(() => {
|
||||
// derived values
|
||||
const totalCycles = currentProjectCycleIds?.length ?? 0;
|
||||
const project = projectId ? getProjectById(projectId?.toString()) : undefined;
|
||||
const pageTitle = project?.name ? `${project?.name} - ${t("cycles.label", { count: 2 })}` : undefined;
|
||||
const pageTitle = project?.name ? `${project?.name} - ${t("common.cycles", { count: 2 })}` : undefined;
|
||||
const hasAdminLevelPermission = allowPermissions([EUserProjectRoles.ADMIN], EUserPermissionsLevel.PROJECT);
|
||||
const hasMemberLevelPermission = allowPermissions(
|
||||
[EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER],
|
||||
|
||||
Reference in New Issue
Block a user