forked from GetStream/react-native-activity-feed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46768b3
commit 7ce2c26
Showing
38 changed files
with
7,820 additions
and
5,168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react"], | ||
"plugins": [ | ||
[ | ||
"i18next-extract", | ||
{ | ||
"contextSeparator": "__", | ||
"defaultContexts": [""], | ||
"defaultNS": "en", | ||
"locales": ["nl", "en", "it", "tr", "fr", "hi", "ru"], | ||
"jsonSpace": 4, | ||
"keySeparator": null, | ||
"nsSeparator": null, | ||
"keyAsDefaultValue": ["en"], | ||
"keyAsDefaultValueForDerivedKeys": false, | ||
"outputPath": "src/i18n/{{locale}}.json", | ||
"discardOldKeys": true | ||
} | ||
], | ||
"@babel/proposal-class-properties", | ||
"@babel/transform-runtime" | ||
] | ||
} |
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,36 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
const i18nDirectoryRelativePath = '../src/i18n/'; | ||
const directoryPath = path.join(__dirname, i18nDirectoryRelativePath); | ||
let countMissingTranslations = 0; | ||
|
||
fs.readdir(directoryPath, function(err, files) { | ||
if (err) { | ||
return console.log('Unable to scan directory: ' + err); | ||
} | ||
|
||
files.forEach(function(file) { | ||
if (file === 'index.js') return; | ||
// Do whatever you want to do with the file | ||
const data = require(i18nDirectoryRelativePath + file); | ||
const keys = Object.keys(data); | ||
keys.forEach((key) => { | ||
if (!data[key] || data[key] === '') { | ||
countMissingTranslations = countMissingTranslations + 1; | ||
console.error( | ||
'\\033[91m', | ||
'Missing translation for key "' + key + '" in "' + file + '"', | ||
); | ||
} | ||
}); | ||
}); | ||
|
||
if (countMissingTranslations > 0) { | ||
process.exitCode = 2; | ||
process.exit(); | ||
} else { | ||
process.exit(0); | ||
} | ||
}); |
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
Oops, something went wrong.