Skip to content

Commit

Permalink
Complete translation of fxos UI elements #1129 (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid authored Nov 11, 2023
1 parent e1903a3 commit 5a4c9ff
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
6 changes: 6 additions & 0 deletions i18n/en.jsonp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions i18n/es.jsonp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion i18n/fr.jsonp.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions www/js/lib/zimArchive.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import zimDirEntry from './zimDirEntry.js';
import util from './util.js';
import uiUtil from './uiUtil.js';
import utf8 from './utf8.js';
import translateUI from './translateUI.js';

/**
* ZIM Archive
Expand Down Expand Up @@ -183,13 +184,15 @@ function ZIMArchive (storage, path, callbackReady, callbackError) {
that._searchArchiveParts(storage, path.slice(0, -2)).then(function (fileArray) {
createZimfile(fileArray);
}).catch(function (error) {
callbackError('Error reading files in split archive ' + path + ': ' + error, 'Error reading archive files');
callbackError((translateUI.t('dialog-readsplitzim-error-message') || 'Error reading files in split archive') + ' ' + path + ' : ' + error,
translateUI.t('dialog-readzim-error-title') || 'Error reading archive file(s)');
});
} else {
storage.get(path).then(function (file) {
createZimfile([file]);
}).catch(function (error) {
callbackError('Error reading ZIM file ' + path + ' : ' + error, 'Error reading archive file');
callbackError((translateUI.t('dialog-readzim-error-message') || 'Error reading ZIM file') + ' ' + path + ' : ' + error,
translateUI.t('dialog-readzim-error-title') || 'Error reading archive file(s)');
});
}
}
Expand Down
13 changes: 8 additions & 5 deletions www/js/lib/zimArchiveLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

'use strict';

/* global $ */

import translateUI from './translateUI.js';
import zimArchive from './zimArchive.js';

/**
Expand Down Expand Up @@ -72,16 +75,16 @@ function scanForArchives (storages, callbackFunction, callbackError) {
$.when.apply(null, promises).then(function () {
callbackFunction(directories);
}).catch(function (error) {
callbackError('Error scanning your device storage : ' + error +
". If you're using the Firefox OS Simulator, please put the archives in " +
"a 'fake-sdcard' directory inside your Firefox profile " +
callbackError((translateUI.t('dialog-scanstorage-error-message') || 'Error scanning your device storage:') + ' ' + error + '. ' +
(translateUI.t('dialog-scanstorage-fxos-error-message') || ("If you're using the Firefox OS Simulator, please put the archives in " +
'a "fake-sdcard" directory inside your Firefox profile ' +
'(ex : ~/.mozilla/firefox/xxxx.default/extensions/[email protected]/' +
'profile/fake-sdcard/wikipedia_en_ray_charles_2015-06.zim)', 'Error reading Device Storage');
'profile/fake-sdcard/wikipedia_en_ray_charles_2015-06.zim)')), translateUI.t('dialog-scanstorage-fxos-error-title') || 'Error scanning Device Storage');
});
}

export default {
loadArchiveFromDeviceStorage: loadArchiveFromDeviceStorage,
loadArchiveFromFiles: loadArchiveFromFiles,
scanForArchives: scanForArchives
};
};

0 comments on commit 5a4c9ff

Please sign in to comment.