Skip to content

Commit

Permalink
fix path to translation files in production build
Browse files Browse the repository at this point in the history
I tested it locally, on Linux. Before this change, the strings would
load correctly when running a test build (npm start), but would fail to
load when creating a production build (npm run build for example).
Now, both builds seem to display text correctly.
  • Loading branch information
Giuseppe Daniele Consoli committed May 10, 2021
1 parent 61c80a4 commit 66a4aad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ExilenceNextApp/src/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const url = require('url');
function getTranslationPath(lng: string, ns: string) {
const langPath = `/i18n/${lng}/${ns}.json`;
const fullPath = url.format({
pathname: path.join(electronService.appPath, `/../../../../public${langPath}`),
pathname: path.join(electronService.appPath, langPath),
protocol: 'file:',
slashes: true,
});
Expand Down

0 comments on commit 66a4aad

Please sign in to comment.