Skip to content

Commit

Permalink
Change: Use a new translations extraction tooling
Browse files Browse the repository at this point in the history
The old tooling was a bit *hackish* and used a babel plugin internally.
Because this tool needed also babel plugins from the deprecated
create-react-app project it got replaced with i18next-parser.
  • Loading branch information
bjoernricks committed Jan 9, 2025
1 parent 341793b commit fce7b58
Show file tree
Hide file tree
Showing 4 changed files with 1,831 additions and 294 deletions.
31 changes: 0 additions & 31 deletions .babelrc

This file was deleted.

30 changes: 30 additions & 0 deletions i18next-parser.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* SPDX-FileCopyrightText: 2025 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

const jsLexer = [{lexer: 'JavascriptLexer', functions: ['_', '_l']}];
const jsxLexer = [{lexer: 'JsxLexer', functions: ['_', '_l']}];

export default {
contextSeparator: null,
defaultNamespace: 'gsa',
input: ['src/**/*.js', 'src/**/*.jsx', 'src/**/*.ts', 'src/**/*.tsx'],
keepRemoved: false,
keySeparator: false,
lexers: {
mjs: jsLexer,
js: jsLexer,
ts: jsLexer,
jsx: jsxLexer,
tsx: jsxLexer,

default: jsLexer,
},
locales: ['de', 'zh_TW', 'zh_CN'],
namespaceSeparator: false,
output: 'public/locales/gsa-$LOCALE.json',
pluralSeparator: false,
resetDefaultValueLocale: 'en',
sort: true,
};
Loading

0 comments on commit fce7b58

Please sign in to comment.