New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite translator for efficiency and clarity #5013

Merged
merged 17 commits into from Sep 12, 2016

Conversation

Projects
None yet
2 participants
@pitaj
Copy link
Contributor

pitaj commented Sep 4, 2016

No description provided.

@julianlam julianlam self-assigned this Sep 12, 2016

@julianlam

This comment has been minimized.

Copy link
Member

julianlam commented Sep 12, 2016

Hey @pitaj, can you remove translator.d.ts, as further changes to this file will be handled via the translator.js file specifially?

var filePath = path.join(__dirname, '../../language', language, filename + '.json');
return exists(filePath).then(function (fileExists) {
if (!fileExists) {
if (plugins.customLanguageFallbacks[filename]) {

This comment has been minimized.

@julianlam

julianlam Sep 12, 2016

Member

This is no longer relevant as of bb80dc3, as plugins.customLanguageFallbacks is no longer set. If the target file is not found, assume '{}' instead (apostrophes included), since the data is added in plugins.customLanguages later on.

um... which got removed. See other note.

data = JSON.parse(data.toString());

if (plugins.customLanguages.hasOwnProperty(hash)) {
_.extendOwn(data, plugins.customLanguages[hash]);

This comment has been minimized.

@julianlam

julianlam Sep 12, 2016

Member

This needs to stay.

@julianlam

This comment has been minimized.

Copy link
Member

julianlam commented Sep 12, 2016

👏

@julianlam julianlam merged commit 59ed13b into NodeBB:master Sep 12, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment