Skip to content

Commit 01da257

Browse files
DIYgoddaiLib-LOCALE
authored
feat(i18n): merge #4597/#4774 and complete localization audit (#4839)
* chore: Update Japanese translations for new features and errors Added and updated multiple Japanese locale strings across AI, app, errors, external, settings, and shortcuts modules. Changes include new labels, descriptions, error messages, and UI text for features such as scheduling, token usage, inbox management, toolbar customization, and quick search. * Add Japanese README documentation Introduces README-ja.md with comprehensive information about Folo, including features, installation instructions, community links, contribution guidelines, code signing policies, and license details for Japanese-speaking users. * Update formatting in Japanese README Corrected the admonition marker from '[!重要]' to '[!IMPORTANT]' for consistency and made minor formatting adjustments in the README-ja.md file. * Update community section in Japanese README Revised wording and formatting in the community participation section of README-ja.md for improved clarity and consistency. * Remove Japanese README file Deleted README-ja.md to reduce duplication or outdated documentation. All relevant information should now be referenced from the main README or other documentation files. * feat: add French (fr-FR) localization * fix: sort imports in default-resource.ts to resolve lint error * feat: add missing French translations for mobile/default, native, and external locales * feat: add French language filter to discovery/recommended feeds * docs: update changelog for French localization * feat(i18n): merge PR #4597/#4774 and finish localization audit --------- Co-authored-by: dai <dosada@gmail.com> Co-authored-by: Anthony Mahé <snpepito@gmail.com> Co-authored-by: Anthony Mahé <104373430+AnthonyMahe@users.noreply.github.com>
1 parent 0859f56 commit 01da257

File tree

62 files changed

+2759
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2759
-106
lines changed

apps/desktop/changelog/next.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
## Shiny new things
44

5+
- Supported French localization.
6+
57
## Improvements
68

79
## No longer broken
810

911
## Thanks
1012

11-
Special thanks to volunteer contributors @ for their valuable contributions
13+
Special thanks to volunteer contributors @AnthonyMahe for their valuable contributions
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DONT EDIT THIS FILE MANUALLY
2-
const langs = ["en", "zh-CN", "zh-TW", "ja"] as const
2+
const langs = ["en", "zh-CN", "zh-TW", "ja", "fr-FR"] as const
33
export const currentSupportedLanguages = langs as readonly string[]
44
export type RendererSupportedLanguages = (typeof langs)[number]
55

@@ -8,6 +8,7 @@ export const dayjsLocaleImportMap = {
88
["zh-CN"]: ["zh-cn", () => import("dayjs/locale/zh-cn")],
99
["ja"]: ["ja", () => import("dayjs/locale/ja")],
1010
["zh-TW"]: ["zh-tw", () => import("dayjs/locale/zh-tw")],
11+
["fr-FR"]: ["fr", () => import("dayjs/locale/fr")],
1112
}
1213
export const ns = ["common", "lang", "errors", "app", "settings", "shortcuts", "ai"] as const
1314
export const defaultNS = "app" as const

apps/desktop/layer/renderer/src/@types/default-resource.electron.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
// DONT EDIT THIS FILE MANUALLY
22
import ai_en from "@locales/ai/en.json"
3+
import ai_frFR from "@locales/ai/fr-FR.json"
34
import ai_ja from "@locales/ai/ja.json"
45
import en from "@locales/app/en.json"
6+
import app_frFR from "@locales/app/fr-FR.json"
57
import app_ja from "@locales/app/ja.json"
68
import app_zhCN from "@locales/app/zh-CN.json"
79
import app_zhTW from "@locales/app/zh-TW.json"
810
import common_en from "@locales/common/en.json"
11+
import common_frFR from "@locales/common/fr-FR.json"
912
import common_ja from "@locales/common/ja.json"
1013
import common_zhCN from "@locales/common/zh-CN.json"
1114
import common_zhTW from "@locales/common/zh-TW.json"
1215
import errors_en from "@locales/errors/en.json"
16+
import errors_frFR from "@locales/errors/fr-FR.json"
1317
import errors_ja from "@locales/errors/ja.json"
1418
import errors_zhCN from "@locales/errors/zh-CN.json"
1519
import errors_zhTW from "@locales/errors/zh-TW.json"
1620
import lang_en from "@locales/lang/en.json"
21+
import lang_frFR from "@locales/lang/fr-FR.json"
1722
import lang_ja from "@locales/lang/ja.json"
1823
import lang_zhCN from "@locales/lang/zh-CN.json"
1924
import lang_zhTW from "@locales/lang/zh-TW.json"
2025
import settings_en from "@locales/settings/en.json"
26+
import settings_frFR from "@locales/settings/fr-FR.json"
2127
import settings_ja from "@locales/settings/ja.json"
2228
import settings_zhCN from "@locales/settings/zh-CN.json"
2329
import settings_zhTW from "@locales/settings/zh-TW.json"
2430
import shortcuts_en from "@locales/shortcuts/en.json"
31+
import shortcuts_frFR from "@locales/shortcuts/fr-FR.json"
2532
import shortcuts_ja from "@locales/shortcuts/ja.json"
2633
import shortcuts_zhCN from "@locales/shortcuts/zh-CN.json"
2734
import shortcuts_zhTW from "@locales/shortcuts/zh-TW.json"
@@ -70,6 +77,15 @@ export const defaultResources = {
7077
errors: errors_zhTW,
7178
ai: ai_en, // Fallback to English until Traditional Chinese translation is available
7279
},
80+
"fr-FR": {
81+
app: app_frFR,
82+
lang: lang_frFR,
83+
common: common_frFR,
84+
settings: settings_frFR,
85+
shortcuts: shortcuts_frFR,
86+
errors: errors_frFR,
87+
ai: ai_frFR,
88+
},
7389
} satisfies Record<
7490
RendererSupportedLanguages,
7591
Partial<Record<(typeof ns)[number], Record<string, string>>>

apps/desktop/layer/renderer/src/@types/default-resource.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
import ai_en from "@locales/ai/en.json"
33
import en from "@locales/app/en.json"
44
import common_en from "@locales/common/en.json"
5+
import common_frFR from "@locales/common/fr-FR.json"
56
import common_ja from "@locales/common/ja.json"
67
import common_zhCN from "@locales/common/zh-CN.json"
78
import common_zhTW from "@locales/common/zh-TW.json"
89
import errors_en from "@locales/errors/en.json"
910
import lang_en from "@locales/lang/en.json"
11+
import lang_frFR from "@locales/lang/fr-FR.json"
1012
import lang_ja from "@locales/lang/ja.json"
1113
import lang_zhCN from "@locales/lang/zh-CN.json"
1214
import lang_zhTW from "@locales/lang/zh-TW.json"
@@ -42,6 +44,7 @@ export const defaultResources = {
4244
common: common_ja,
4345
},
4446
"zh-TW": { lang: lang_zhTW, common: common_zhTW },
47+
"fr-FR": { lang: lang_frFR, common: common_frFR },
4548
} satisfies Record<
4649
RendererSupportedLanguages,
4750
Partial<Record<(typeof ns)[number], Record<string, string>>>

apps/desktop/layer/renderer/src/modules/discover/DiscoveryContent.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ const LanguageOptions = [
1818
label: "words.english",
1919
value: "eng",
2020
},
21+
{
22+
label: "words.french",
23+
value: "fra",
24+
},
2125
{
2226
label: "words.chinese",
2327
value: "cmn",
2428
},
2529
] satisfies ResponsiveSelectItem[]
2630

27-
type Language = "all" | "eng" | "cmn"
31+
type Language = "all" | "eng" | "cmn" | "fra"
2832
type DiscoveryView = "trending" | "categories"
2933

3034
export function DiscoveryContent() {

apps/desktop/layer/renderer/src/modules/trending/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ const LanguageOptions = [
2525
label: "words.chinese",
2626
value: "cmn",
2727
},
28+
{
29+
label: "words.french",
30+
value: "fra",
31+
},
2832
]
2933

30-
type Language = "all" | "eng" | "cmn"
34+
type Language = "all" | "eng" | "cmn" | "fra"
3135

3236
type View = "all" | string
3337

@@ -64,6 +68,7 @@ export function Trending({
6468
const { t: tCommon } = useTranslation("common")
6569
const lang = useUISettingKey("discoverLanguage")
6670
const { onUpdateMaxScroll } = useScrollElementUpdate()
71+
const trendingLanguage = lang === "fra" ? "eng" : lang
6772

6873
const [selectedView, setSelectedView] = useState<View>("all")
6974
const viewOptions = useMemo(() => buildViewOptions(), [])
@@ -72,7 +77,7 @@ export function Trending({
7277
queryKey: ["trending", lang, selectedView],
7378
queryFn: async () => {
7479
return await followClient.api.trending.getFeeds({
75-
language: lang === "all" ? undefined : lang,
80+
language: trendingLanguage === "all" ? undefined : trendingLanguage,
7681
view: selectedView === "all" ? undefined : Number(selectedView),
7782
limit,
7883
})

apps/desktop/layer/renderer/src/pages/(main)/(layer)/(subview)/discover/category/[category].tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const LanguageMap = {
2626
all: "all",
2727
eng: "en",
2828
cmn: "zh-CN",
29+
fra: "fr-FR",
2930
} as const
3031

3132
export const Component = () => {
@@ -134,7 +135,7 @@ export const Component = () => {
134135
) : items.length > 0 ? (
135136
<div className="w-full px-8 pb-8 pt-4">
136137
<Input
137-
placeholder="Search"
138+
placeholder={t("words.search", { ns: "common" })}
138139
className="mb-4"
139140
value={search}
140141
onChange={(e) => {
@@ -162,12 +163,10 @@ export const Component = () => {
162163
<EmptyIcon />
163164
</div>
164165
<p className="text-title2 text-text">
165-
{t("common.noContent", { defaultValue: "No content found in this category" })}
166+
{t("discover.empty.no_content", { ns: "common" })}
166167
</p>
167168
<p className="mt-2 text-body text-text-secondary">
168-
{t("discover.tryAnotherCategory", {
169-
defaultValue: "Try selecting another category or language",
170-
})}
169+
{t("discover.empty.try_another_category_or_language", { ns: "common" })}
171170
</p>
172171
</div>
173172
)}

apps/mobile/changelog/next.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
## Shiny new things
44

5+
- Supported French localization.
6+
57
## Improvements
68

79
## No longer broken
810

911
## Thanks
1012

11-
Special thanks to volunteer contributors @ for their valuable contributions
13+
Special thanks to volunteer contributors @AnthonyMahe for their valuable contributions

apps/mobile/src/components/errors/GlobalErrorScreen.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { applicationName } from "expo-application"
22
import * as React from "react"
3+
import { useTranslation } from "react-i18next"
34
import { TouchableOpacity, View } from "react-native"
45

56
import { Text } from "@/src/components/ui/typography/Text"
@@ -9,22 +10,23 @@ interface GlobalErrorScreenProps {
910
resetError?: () => void
1011
}
1112
export const GlobalErrorScreen: React.FC<GlobalErrorScreenProps> = ({ error, resetError }) => {
13+
const { t } = useTranslation("common")
1214
return (
1315
<View className="flex-1 bg-system-background">
1416
<View className="flex-1 items-center justify-center px-6">
1517
<Text className="mb-6 text-[64px]">😕</Text>
1618
<Text className="mb-3 text-center text-xl font-semibold text-label">
17-
{applicationName} crashed!
19+
{t("error_screen.crashed", { appName: applicationName ?? "App" })}
1820
</Text>
1921
<Text className="mb-8 text-center text-lg text-secondary-label">
20-
{error?.message || "An unexpected error occurred."}
22+
{error?.message || t("error_screen.unexpected")}
2123
</Text>
2224
{resetError && (
2325
<TouchableOpacity
2426
className="min-w-[160px] rounded-xl bg-accent px-6 py-3"
2527
onPress={resetError}
2628
>
27-
<Text className="text-center text-[17px] font-semibold text-white">Try Again</Text>
29+
<Text className="text-center text-[17px] font-semibold text-white">{t("retry")}</Text>
2830
</TouchableOpacity>
2931
)}
3032
</View>

apps/mobile/src/components/errors/ListErrorView.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useTranslation } from "react-i18next"
12
import { TouchableOpacity, View } from "react-native"
23
import { useColor } from "react-native-uikit-colors"
34

@@ -7,6 +8,7 @@ import { AlertCuteFiIcon } from "@/src/icons/alert_cute_fi"
78
import { MonoText } from "../ui/typography/MonoText"
89

910
export const ListErrorView = ({ error, resetError }: { error: Error; resetError: () => void }) => {
11+
const { t } = useTranslation("common")
1012
const red = useColor("red")
1113
return (
1214
<View className="flex-1 items-center justify-center p-4">
@@ -15,17 +17,17 @@ export const ListErrorView = ({ error, resetError }: { error: Error; resetError:
1517
<AlertCuteFiIcon color={red} height={48} width={48} />
1618
</View>
1719
<Text className="mb-2 text-center text-lg font-semibold text-label">
18-
Unable to Load Content
20+
{t("error_screen.list_unable_to_load")}
1921
</Text>
2022
<Text className="mb-2 text-center text-base text-secondary-label">
21-
There was a problem loading the list. Please try again later.
23+
{t("error_screen.list_try_later")}
2224
</Text>
2325
<MonoText className="mb-4 text-center text-base text-secondary-label">
24-
{error.message || "Unknown Error"}
26+
{error.message || t("error_screen.unknown")}
2527
</MonoText>
2628

2729
<TouchableOpacity className="w-full rounded-xl bg-accent px-6 py-3" onPress={resetError}>
28-
<Text className="text-center text-base font-semibold text-white">Try Again</Text>
30+
<Text className="text-center text-base font-semibold text-white">{t("retry")}</Text>
2931
</TouchableOpacity>
3032
</View>
3133
</View>

0 commit comments

Comments
 (0)