forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert translation to typescript (#74)
* Convert translation to typescript * update input types * update travis * update node version
- Loading branch information
1 parent
08898b0
commit dbfdd8c
Showing
14 changed files
with
89 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation/src/index.js
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-translation/src/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { configure, t, tn } from './TranslatorSingleton'; | ||
export { TranslatorConfig, LanguagePack } from './Translator'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
14 changes: 0 additions & 14 deletions
14
...orary_superset_ui/superset-ui/packages/superset-ui-translation/test/languagePacks/en.json
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...mporary_superset_ui/superset-ui/packages/superset-ui-translation/test/languagePacks/en.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LanguagePack } from 'jed'; | ||
|
||
const languagePack: LanguagePack = { | ||
domain: 'superset', | ||
locale_data: { | ||
superset: { | ||
'': { | ||
domain: 'superset', | ||
plural_forms: 'nplurals=2; plural=(n != 1)', | ||
lang: 'en', | ||
}, | ||
second: [''], | ||
'Copy of %s': [''], | ||
}, | ||
}, | ||
}; | ||
|
||
export default languagePack; |
14 changes: 0 additions & 14 deletions
14
...orary_superset_ui/superset-ui/packages/superset-ui-translation/test/languagePacks/zh.json
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...mporary_superset_ui/superset-ui/packages/superset-ui-translation/test/languagePacks/zh.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { LanguagePack } from 'jed'; | ||
|
||
const languagePack: LanguagePack = { | ||
domain: 'superset', | ||
locale_data: { | ||
superset: { | ||
'': { | ||
domain: 'superset', | ||
plural_forms: 'nplurals=2; plural=(n != 1)', | ||
lang: 'zh', | ||
}, | ||
second: ['秒'], | ||
'Copy of %s': ['%s 的副本', '%s 的副本本本'], | ||
}, | ||
}, | ||
}; | ||
|
||
export default languagePack; |
22 changes: 22 additions & 0 deletions
22
...nd/temporary_superset_ui/superset-ui/packages/superset-ui-translation/types/external.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare module 'jed' { | ||
export interface LanguagePack { | ||
domain: string; | ||
locale_data: { | ||
superset: { | ||
[key: string]: string[] | { | ||
domain: string; | ||
plural_forms: string; | ||
lang: string; | ||
}; | ||
}; | ||
} | ||
} | ||
|
||
export default class Jed { | ||
constructor(languagepack: LanguagePack); | ||
|
||
translate(input: string): Jed; | ||
ifPlural(value: number, plural: string): Jed; | ||
fetch(...args: any[]): string; | ||
} | ||
} |