Skip to content

Commit

Permalink
Add Astro internationalization routing
Browse files Browse the repository at this point in the history
Add i18next for locale variables
Add lang content for controls

Co-authored-by: Alberto Ito <[email protected]>
  • Loading branch information
Alberto-Ito and alberto-ito-deltatre authored Nov 28, 2024
1 parent bc71eac commit 94eca90
Show file tree
Hide file tree
Showing 40 changed files with 1,122 additions and 211 deletions.
12 changes: 12 additions & 0 deletions astro-i18next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { DEFAULT_LOCALE, LOCALES } from "./src/config/i18nConfig.js";

export default {
defaultLocale: DEFAULT_LOCALE,
locales: LOCALES,
load: ["server", "client"],
resourcesBasePath: "/locales",
showDefaultLocale: true,
i18nextServer: {
debug: true,
}
};
11 changes: 10 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { defineConfig } from "astro/config";
import astroI18next from "astro-i18next";
import aws from "astro-sst";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import solidJs from "@astrojs/solid-js";
import pagefind from "./integrations/pagefind";
import auth from "./integrations/auth";
import { loadEnv } from "vite";

import { LOCALES, DEFAULT_LOCALE } from "./src/config/i18nConfig";

const { IS_PUBLIC, PRE_BUILD, CUSTOM_DOMAIN } = loadEnv(
process.env.NODE_ENV,
Expand All @@ -32,6 +33,7 @@ export default defineConfig({
applyBaseStyles: false,
}),
solidJs(),
astroI18next(),
],
}
: {
Expand Down Expand Up @@ -65,5 +67,12 @@ export default defineConfig({
},
vite: {
optimizeDeps: { exclude: ['auth:config'] },
},
i18n: {
defaultLocale: DEFAULT_LOCALE,
locales: LOCALES,
routing: {
prefixDefaultLocale: true,
}
}
});
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
"@biscuit-auth/biscuit-wasm": "^0.4.0",
"@solid-primitives/pagination": "^0.2.8",
"astro": "4.4.5",
"astro-i18next": "^1.0.0-beta.21",
"astro-pagefind": "^1.4.0",
"astro-sst": "^2.40.3",
"auth-astro": "^4.1.1",
"dayjs": "^1.11.10",
"i18next": "^23.16.4",
"js-yaml": "^4.1.0",
"sass": "^1.63.6",
"set-cookie-parser": "^2.6.0",
"solid-icons": "^1.1.0",
Expand Down
118 changes: 118 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"header": {
"main": "Windows on Arm Ready Software"
},
"bradcrumbs": {
"home": "Home",
"contributing": "Contributing",
"applications": "Applications",
"search": "Search",
"games": "Games"
},
"footer": {
"report_an_issue": "Report an issue",
"edit_on_github": "Edit on Github",
"legal": "Legal",
"contact": "Contact",
"help": "Help",
"takedown": "Content takedown request",
"copyright": "All product names, logos, brands, trademarks and registered trademarks are property of their respective owners. Accuracy of the data is not guaranteed by Linaro.",
"games_count": "games"
},
"search": {
"search": "Search",
"clear_search": "Clear search",
"no_information_start": "There is no information in our data about that. Why not contact the developer on their web site, or complete a feedback request",
"no_information_here": "here",
"no_information_end": "for us to investigate."
},
"applications": {
"info": "Below are some of the top apps that have been tested. Use the search bar to search for other tested apps.",
"search_button": "Search for more applications",
"search_placeholder": "Search for applications",
"search_instruction": "To begin searching, enter a search query and press enter, or choose a category",
"categories": "Categories",
"version_from": "Version From",
"download": "Download",
"report_last_updated": "Report last updated",
"website": "Website",
"more_info": "More Info"
},
"games": {
"search_placeholder": "Search for games",
"user_reports": "User Reports",
"publisher": "Publisher",
"categories": "Categories",
"date_tested": "Date tested",
"frame_rate": "Frame Rate",
"device_configuration": "Device Configuration",
"os_build_number": "OS Build Number",
"driver_id": "Driver ID",
"auto_super_resolution": "Auto Super Resolution",
"compatible": "Compatible",
"enablement": "Enablement",
"fps_boost": "FPS Boost",
"opt_in_steps": "Opt In Steps",
"compatibility": "Compatibility",
"auto_sr": "Auto SR",
"link": "Link",
"notes": "Notes",
"details": "Details"
},
"application_form": {
"title": "Application request form",
"description": "Please fill out the following information about the application compatibility.",
"app_name": "Name of App",
"publisher": "Publisher",
"report_type": {
"description": "What are you reporting?",
"request_test": "Request for this app to be tested",
"submit_update": "Submit new or updated app information"
},
"app_category": {
"description": "App Category",
"instruction": "Select one or more categories from the list below. To select multiple options, hold 'Ctrl' while clicking",
"fetching_categories": "Fetching application categories. Please wait..."
},
"download_url": "URL for app download, or developer site",
"displayed_arm_compatibility": "Displayed Arm compatibility?",
"earliest_compatible_version": "Earliest compatible version number",
"execution_compatibility": "Execution compatibility",
"icon": {
"description": "Icon URL",
"instruction": "Link to an app icon (512x512 max size, SVG preferred)"
},
"submit_button": "Submit",
"submit_succeeded": "Application form successfully sent, thanks for your collaboration!",
"submit_failed": "An error occurred!"
},
"game_form": {
"title": "Game request form",
"description": "Please fill out the following information about the game compatibility.",
"game_name": "Name of Game",
"game_category": {
"description": "Game Category",
"instruction": "Select one category from the list below.",
"fetching_categories": "Fetching game categories. Please wait..."
},
"publisher": "Publisher",
"compatibility": {
"description": "Compatibility",
"perfect": "Perfect - Runs at 60+ FPS at 1080p resolution with no glitches / issues that affect gaming experience",
"playable": "Playable - Runs at 30+ FPS at 1080p resolution with minimal glitches/ issues that affect gaming experience",
"runs": "Runs - Runs at less than 30 FPS and/or with bugs that may affect gaming experience",
"unplayable": "Unplayable - Does not run due to anti-cheat or other failures"
},
"device_configuration": "Device Configuration",
"date_tested": "Date tested",
"os_version": "Os Version",
"driver_id": "Driver ID",
"compatibility_details": "Compatibility Details",
"auto_super_resolution_compatibility": "Auto Super Resolution Compatibility",
"auto_super_resolution_fps_bost": "Auto Super Res FPS boost",
"your_name_gamertag": "Your name/gamertag",
"submit_button": "Submit",
"submit_succeeded": "Game form successfully sent, thanks for your collaboration!",
"submit_failed": "An error occurred!"
}
}
118 changes: 118 additions & 0 deletions public/locales/ja/translation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"header": {
"main": "Arm向けのWindows対応ソフトウェア"
},
"bradcrumbs": {
"home": "ホーム",
"contributing": "貢献",
"applications": "アプリケーション",
"search": "検索",
"games": "ゲーム"
},
"footer": {
"report_an_issue": "問題を報告する",
"edit_on_github": "Githubで編集",
"legal": "法的事項",
"contact": "連絡先",
"help": "ヘルプ",
"takedown": "コンテンツ削除リクエスト",
"copyright": "すべての製品名、ロゴ、ブランド、商標、登録商標はそれぞれの所有者に帰属します。データの正確性はLinaroによって保証されません。",
"games_count": "ゲーム"
},
"search": {
"search": "検索",
"clear_search": "検索をクリア",
"no_information_start": "その情報はデータにありません。開発者のウェブサイトで連絡してみるか、調査のために",
"no_information_here": "こちら",
"no_information_end": "からフィードバックリクエストを送信してください。"
},
"applications": {
"info": "以下はテスト済みのトップアプリの一部です。検索バーを使用して他のテスト済みアプリを検索してください。",
"search_button": "他のアプリケーションを検索",
"search_placeholder": "アプリケーションを検索",
"search_instruction": "検索を開始するには、検索クエリを入力してEnterを押すか、カテゴリを選択してください",
"categories": "カテゴリ",
"version_from": "バージョン",
"download": "ダウンロード",
"report_last_updated": "レポートの最終更新日",
"website": "ウェブサイト",
"more_info": "詳細情報"
},
"games": {
"search_placeholder": "ゲームを検索",
"user_reports": "ユーザーレポート",
"publisher": "発行者",
"categories": "カテゴリ",
"date_tested": "テスト日",
"frame_rate": "フレームレート",
"device_configuration": "デバイス構成",
"os_build_number": "OSビルド番号",
"driver_id": "ドライバーID",
"auto_super_resolution": "自動スーパー解像度",
"compatible": "互換性あり",
"enablement": "有効化",
"fps_boost": "FPSブースト",
"opt_in_steps": "オプトイン手順",
"compatibility": "互換性",
"auto_sr": "自動SR",
"link": "リンク",
"notes": "備考",
"details": "詳細"
},
"application_form": {
"title": "アプリケーションリクエストフォーム",
"description": "アプリケーションの互換性に関する情報を以下に記入してください。",
"app_name": "アプリ名",
"publisher": "発行元",
"report_type": {
"description": "何を報告していますか?",
"request_test": "このアプリのテストをリクエスト",
"submit_update": "新しいまたは更新されたアプリ情報を提出"
},
"app_category": {
"description": "アプリカテゴリー",
"instruction": "以下のリストから1つ以上のカテゴリーを選択してください。複数のオプションを選択するには、'Ctrl' を押しながらクリック",
"fetching_categories": "アプリカテゴリーを取得中です。しばらくお待ちください..."
},
"download_url": "アプリダウンロード用URL、または開発者サイト",
"displayed_arm_compatibility": "表示されるARM互換性は?",
"earliest_compatible_version": "最初に互換性があるバージョン番号",
"execution_compatibility": "実行互換性",
"icon": {
"description": "アイコンURL",
"instruction": "アプリのアイコンへのリンク(最大512x512、SVGを推奨)"
},
"submit_button": "送信",
"submit_succeeded": "アプリケーションフォームが正常に送信されました。ご協力ありがとうございます!",
"submit_failed": "エラーが発生しました!"
},
"game_form": {
"title": "ゲームリクエストフォーム",
"description": "ゲームの互換性に関する以下の情報を記入してください。",
"game_name": "ゲーム名",
"game_category": {
"description": "ゲームカテゴリ",
"instruction": "下のリストから1つのカテゴリを選択してください。",
"fetching_categories": "ゲームカテゴリを取得中です。しばらくお待ちください..."
},
"publisher": "出版社",
"compatibility": {
"description": "互換性",
"perfect": "Perfect - 1080p 解像度で 60 FPS 以上で動作し、ゲーム体験に影響を与えるグリッチや問題はありません",
"playable": "Playable - 1080p 解像度で 30 FPS 以上で動作し、ゲーム体験に最小限のグリッチや問題があります",
"runs": "Runs - 30 FPS 未満で動作し、ゲーム体験に影響を与えるバグがあります",
"unplayable": "Unplayable - アンチチートやその他の失敗により動作しません"
},
"device_configuration": "デバイス構成",
"date_tested": "テスト日",
"os_version": "OS バージョン",
"driver_id": "ドライバー ID",
"compatibility_details": "互換性の詳細",
"auto_super_resolution_compatibility": "オートスーパー解像度互換性",
"auto_super_resolution_fps_bost": "オートスーパー解像度 FPS 向上",
"your_name_gamertag": "あなたの名前/ゲーマータグ",
"submit_button": "送信",
"submit_succeeded": "ゲームフォームが正常に送信されました。ご協力ありがとうございます!",
"submit_failed": "エラーが発生しました!"
}
}
Loading

0 comments on commit 94eca90

Please sign in to comment.