Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ jobs:
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
run: ${{ steps.detect-package-manager.outputs.runner }} npm run build:i18n
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_URL: https://ruffle.rs
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./out
path: ./dist

# Deployment job
deploy:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# next.js
/.next/
/out/
/dist

# production
/build
Expand Down
10 changes: 10 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ export default [
files: ["postcss.config.js", "next.config.js"],
languageOptions: {
sourceType: "commonjs",
globals: {
require: "readonly",
module: "writable",
__dirname: "readonly",
__filename: "readonly",
process: "readonly",
},
},
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
];
5 changes: 5 additions & 0 deletions messages/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"locale.name": "English – United States",
"home.title": "An open source Flash Player emulator",
"footer.tagline": "Putting Flash back on the web"
}
5 changes: 5 additions & 0 deletions messages/pl-PL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"locale.name": "Polski – Polska",
"home.title": "Emulator Flash Playera, który jest open source",
"footer.tagline": "Przywracamy Flasha do sieci"
}
18 changes: 17 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// @ts-check

const path = require("path");

const locale = process.env.NEXT_PUBLIC_BUILD_LOCALE || "en-US";
const defaultLocale = "en-US";

/**
* @type {import('next').NextConfig}
**/
Expand All @@ -8,7 +13,18 @@ const nextConfig = {
images: {
unoptimized: true,
},
basePath: "",
basePath: locale === defaultLocale ? "" : `/${locale}`,
turbopack: {
resolveAlias: {
"i18n:messages": `./messages/${locale}.json`,
},
},
webpack: (config) => {
config.resolve.alias["i18n:messages"] = path.resolve(
`./messages/${locale}.json`,
);
return config;
},
};

module.exports = nextConfig;
Loading