mirror of
https://github.com/jellyfin/jellyfin-expo.git
synced 2024-11-22 21:49:46 +00:00
Add test for i18n
This commit is contained in:
parent
3f1319bf2c
commit
672738f60a
14
__tests__/i18n.test.js
Normal file
14
__tests__/i18n.test.js
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
import i18next, { resources } from '../i18n';
|
||||
|
||||
describe('i18n', () => {
|
||||
it('should initialize i18next', () => {
|
||||
for (const lng of Object.keys(resources)) {
|
||||
expect(i18next.hasResourceBundle(lng, 'translation')).toBe(true);
|
||||
}
|
||||
});
|
||||
});
|
5
i18n.js
5
i18n.js
@ -37,7 +37,7 @@ import ta from './langs/ta.json';
|
||||
import zh_Hans from './langs/zh_Hans.json';
|
||||
import zh_Hant from './langs/zh_Hant.json';
|
||||
|
||||
const resources = {
|
||||
export const resources = {
|
||||
en: { translation: en },
|
||||
ar: { translation: ar },
|
||||
bg: { translation: bg },
|
||||
@ -82,3 +82,6 @@ i18next
|
||||
},
|
||||
resources
|
||||
});
|
||||
|
||||
// Export i18next instance for use in tests
|
||||
export default i18next;
|
||||
|
Loading…
Reference in New Issue
Block a user