Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: move language files to the root directory to share them with both Flutter and Tauri. (#2970)

Lucas.Xu3d72b6fa1279
diff --git a/frontend/appflowy_flutter/.gitignore b/frontend/appflowy_flutter/.gitignore
index 52bcfb1538..bbf63caa3e 100644
--- a/frontend/appflowy_flutter/.gitignore
+++ b/frontend/appflowy_flutter/.gitignore
@@ -75,3 +75,5 @@ windows/flutter/dart_ffi/
coverage/
**/failures/*.png
+
+assets/translations/*.json
diff --git a/frontend/appflowy_flutter/assets/translations/ar-SA.json b/frontend/resources/translations/ar-SA.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/ar-SA.json
rename to frontend/resources/translations/ar-SA.json
diff --git a/frontend/appflowy_flutter/assets/translations/ca-ES.json b/frontend/resources/translations/ca-ES.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/ca-ES.json
rename to frontend/resources/translations/ca-ES.json
diff --git a/frontend/appflowy_flutter/assets/translations/de-DE.json b/frontend/resources/translations/de-DE.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/de-DE.json
rename to frontend/resources/translations/de-DE.json
diff --git a/frontend/appflowy_flutter/assets/translations/en.json b/frontend/resources/translations/en.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/en.json
rename to frontend/resources/translations/en.json
diff --git a/frontend/appflowy_flutter/assets/translations/es-VE.json b/frontend/resources/translations/es-VE.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/es-VE.json
rename to frontend/resources/translations/es-VE.json
diff --git a/frontend/appflowy_flutter/assets/translations/eu-ES.json b/frontend/resources/translations/eu-ES.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/eu-ES.json
rename to frontend/resources/translations/eu-ES.json
diff --git a/frontend/appflowy_flutter/assets/translations/fr-CA.json b/frontend/resources/translations/fr-CA.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/fr-CA.json
rename to frontend/resources/translations/fr-CA.json
diff --git a/frontend/appflowy_flutter/assets/translations/fr-FR.json b/frontend/resources/translations/fr-FR.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/fr-FR.json
rename to frontend/resources/translations/fr-FR.json
diff --git a/frontend/appflowy_flutter/assets/translations/hu-HU.json b/frontend/resources/translations/hu-HU.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/hu-HU.json
rename to frontend/resources/translations/hu-HU.json
diff --git a/frontend/appflowy_flutter/assets/translations/id-ID.json b/frontend/resources/translations/id-ID.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/id-ID.json
rename to frontend/resources/translations/id-ID.json
diff --git a/frontend/appflowy_flutter/assets/translations/it-IT.json b/frontend/resources/translations/it-IT.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/it-IT.json
rename to frontend/resources/translations/it-IT.json
diff --git a/frontend/appflowy_flutter/assets/translations/ja-JP.json b/frontend/resources/translations/ja-JP.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/ja-JP.json
rename to frontend/resources/translations/ja-JP.json
diff --git a/frontend/appflowy_flutter/assets/translations/ko-KR.json b/frontend/resources/translations/ko-KR.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/ko-KR.json
rename to frontend/resources/translations/ko-KR.json
diff --git a/frontend/appflowy_flutter/assets/translations/pl-PL.json b/frontend/resources/translations/pl-PL.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/pl-PL.json
rename to frontend/resources/translations/pl-PL.json
diff --git a/frontend/appflowy_flutter/assets/translations/pt-BR.json b/frontend/resources/translations/pt-BR.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/pt-BR.json
rename to frontend/resources/translations/pt-BR.json
diff --git a/frontend/appflowy_flutter/assets/translations/pt-PT.json b/frontend/resources/translations/pt-PT.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/pt-PT.json
rename to frontend/resources/translations/pt-PT.json
diff --git a/frontend/appflowy_flutter/assets/translations/ru-RU.json b/frontend/resources/translations/ru-RU.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/ru-RU.json
rename to frontend/resources/translations/ru-RU.json
diff --git a/frontend/appflowy_flutter/assets/translations/sv.json b/frontend/resources/translations/sv.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/sv.json
rename to frontend/resources/translations/sv.json
diff --git a/frontend/appflowy_flutter/assets/translations/tr-TR.json b/frontend/resources/translations/tr-TR.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/tr-TR.json
rename to frontend/resources/translations/tr-TR.json
diff --git a/frontend/appflowy_flutter/assets/translations/zh-CN.json b/frontend/resources/translations/zh-CN.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/zh-CN.json
rename to frontend/resources/translations/zh-CN.json
diff --git a/frontend/appflowy_flutter/assets/translations/zh-TW.json b/frontend/resources/translations/zh-TW.json
similarity index 100%
rename from frontend/appflowy_flutter/assets/translations/zh-TW.json
rename to frontend/resources/translations/zh-TW.json
diff --git a/frontend/scripts/code_generation/language_files/generate_language_files.cmd b/frontend/scripts/code_generation/language_files/generate_language_files.cmd
index 146e8188e5..470f1654e5 100644
--- a/frontend/scripts/code_generation/language_files/generate_language_files.cmd
+++ b/frontend/scripts/code_generation/language_files/generate_language_files.cmd
@@ -10,6 +10,11 @@ cd /d "%~dp0"
cd ..\..\..\appflowy_flutter
+REM copy the resources/translations folder to
+REM the appflowy_flutter/assets/translation directory
+echo Copying resources/translations to appflowy_flutter/assets/translations
+xcopy /E /Y /I ..\resources\translations assets\translations
+
call flutter packages pub get
echo Specifying source directory for AppFlowy Localizations.
diff --git a/frontend/scripts/code_generation/language_files/generate_language_files.sh b/frontend/scripts/code_generation/language_files/generate_language_files.sh
index dc624eb889..d3bdf7e9b3 100755
--- a/frontend/scripts/code_generation/language_files/generate_language_files.sh
+++ b/frontend/scripts/code_generation/language_files/generate_language_files.sh
@@ -10,6 +10,10 @@ cd "$(dirname "$0")"
# Navigate to the project root
cd ../../../appflowy_flutter
+# copy the resources/translations folder to
+# the appflowy_flutter/assets/translation directory
+cp -r ../resources/translations assets/translations
+
flutter packages pub get
echo "Specifying source directory for AppFlowy Localizations."
diff --git a/inlang.config.js b/inlang.config.js
index 69730af126..7cabab7896 100644
--- a/inlang.config.js
+++ b/inlang.config.js
@@ -9,8 +9,8 @@ export async function defineConfig(env) {
return {
referenceLanguage: 'en',
- plugins: [pluginJson({
- pathPattern: './frontend/appflowy_flutter/assets/translations/{language}.json',
+ plugins: [pluginJson({
+ pathPattern: './frontend/resources/translations/{language}.json',
variableReferencePattern: ["@:"]
}), standardLintRules()]
};