Skip to content

Commit

Permalink
fix: supporting groups in routing parts (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahinvardar authored Jul 3, 2023
1 parent 333d201 commit 230fc13
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vardario/svelte-i18next",
"version": "0.1.15",
"version": "0.1.16",
"description": "",
"license": "MIT",
"author": "Sahin Vardar",
Expand Down
2 changes: 1 addition & 1 deletion src/extract-i18n-keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('extract-i18n-keys', () => {
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
const exampleDir = path.resolve(__dirname, '../assets/example');

const keys = await extractI18NextKeys([exampleDir]);
const keys = await extractI18NextKeys([exampleDir]);

expect(keys.sort()).toStrictEqual(
[
Expand Down
2 changes: 1 addition & 1 deletion src/string-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export function extractKeyPathFromFile(filename: string) {
const index = pathParts.findIndex(pathPart => regEx.exec(pathPart));

const result = pathParts.slice(index).join('.');
return result.replace('.svelte', '').replace('+', '').replace(/\[|\]/g, '');
return result.replace('.svelte', '').replace('+', '').replace(/\[|\]/g, '').replace(/\((.+)\)\./, '');
}

0 comments on commit 230fc13

Please sign in to comment.