Skip to content

Commit

Permalink
move text tothe localization file. Fix translation
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriiNazarenkoTine committed Apr 3, 2024
1 parent c15fbbf commit 82a4ded
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = rr-manager
SPK_VERS = 2.0
SPK_REV = 11
SPK_REV = 12
SPK_ICON = src/rr-manager.png

DSM_UI_DIR = app
Expand Down Expand Up @@ -85,7 +85,7 @@ rr-manager_extra_install:
install -m 644 src/app/help/$${language}/simpleapp_index.html $(STAGING_DIR)/app/help/$${language}/simpleapp_index.html; \
done
install -m 755 -d $(STAGING_DIR)/app/texts
for language in enu fre; do \
for language in enu fre chs; do \
install -m 755 -d $(STAGING_DIR)/app/texts/$${language}; \
install -m 644 src/app/texts/$${language}/strings $(STAGING_DIR)/app/texts/$${language}/strings; \
done
22 changes: 11 additions & 11 deletions src/app/rr-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Ext.define("SYNOCOMMUNITY.RRManager.Overview.Main", {
handleFileUpload: function (jsonData) {
this._handleFileUpload(jsonData).then(x => {
this.runScheduledTask('ApplyRRConfig');
this.showMsg('The RR config has been successfully applied. Please restart the NAS to apply the changes.');
this.showMsg(this._V('ui', 'rr_config_applied'));
this.appWin.clearStatusBusy();
});
},
Expand Down Expand Up @@ -184,8 +184,8 @@ Ext.define("SYNOCOMMUNITY.RRManager.Overview.Main", {
var sharesList = x.shares;
var downloadsShareMetadata = sharesList.find(x => x.path.toLowerCase() == shareName);
if (!downloadsShareMetadata) {
var msg = formatString(_V('ui', 'share_notfound_msg'), config['SHARE_NAME']);
self.appWin.setStatusBusy({ text: 'Checking the dependencies...' });
var msg = this.formatString(this._V('ui', 'share_notfound_msg'), config['SHARE_NAME']);
self.appWin.setStatusBusy({ text: this._V('ui', 'checking_dependencies_loader') });
self.showMsg('error', msg);
return;
}
Expand Down Expand Up @@ -252,8 +252,8 @@ Ext.define("SYNOCOMMUNITY.RRManager.Overview.Main", {
}
}, self,
{
cancel: { text: 'Cancel' },
yes: { text: 'Agree', btnStyle: 'red' }
cancel: { text: _T("common", "cancel") },
yes: { text: _T("common", "agree"), btnStyle: 'red' }
}, {
icon: "confirm-delete-icon"
}
Expand Down Expand Up @@ -785,13 +785,13 @@ Ext.define("SYNOCOMMUNITY.RRManager.Overview.HealthPanel", {
},
failure: (response) => {
self.appWin.clearStatusBusy();
self.showMsg("title", "Error file uploading.");
self.showMsg("title", self._V('ui', 'file_uploading_failed_msg'));
console.log(response);
},
progress: (progressEvent) => {
const percentage = ((progressEvent.loaded / progressEvent.total) * 100).toFixed(2);
self.appWin.clearStatusBusy();
self.appWin.setStatusBusy({ text: `${_T("common", "loading")}. Completed: ${percentage}%.` }, percentage);
self.appWin.setStatusBusy({ text: `${_T("common", "loading")}. ${self._V("ui", "completed")} ${percentage}%.` }, percentage);
},
});
}
Expand Down Expand Up @@ -990,7 +990,7 @@ Ext.define("SYNOCOMMUNITY.RRManager.Overview.HealthPanel", {
},
createActionsSection: function () {
return new SYNO.ux.FieldSet({
title: 'RR Actions',
title: this._V('ui', 'section_rr_actions'),
items: [
{
xtype: 'syno_panel',
Expand All @@ -1003,7 +1003,7 @@ Ext.define("SYNOCOMMUNITY.RRManager.Overview.HealthPanel", {
hideLabel: true,
items: [{
xtype: 'syno_displayfield',
value: 'Run Update: ',
value: this._V('ui', 'run_update'),
width: 140
}, {
xtype: 'syno_button',
Expand Down Expand Up @@ -2079,7 +2079,7 @@ Ext.define("SYNOCOMMUNITY.RRManager.Setting.Main", {
if (!this.isAnyFormDirty())
return (
this.setStatusError({
text: "Nothing to save",
text: this._V("ui", "frm_validation_no_change"),
clear: !0,
}),
!1
Expand All @@ -2089,7 +2089,7 @@ Ext.define("SYNOCOMMUNITY.RRManager.Setting.Main", {
!e ||
(this.setActiveTab(e.itemId),
this.setStatusError({
text: "Please fill in the required field(s).",
text: this._V("ui", "frm_validation_fill_required_fields"),
}),
!1)
);
Expand Down
13 changes: 12 additions & 1 deletion src/app/texts/enu/strings
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,15 @@ required_components_missing_spinner_msg = "It seems like some of the tasks are m
file_uploading_succesfull_msg = "File has been successfully uploaded. Would you like to run update procedure?"
update_confirm_title = "Confirm update"
uploading_file = "Uploading file..."
save_addons_changes = "Save addons changes"
save_addons_changes = "Save addons changes"

rr_config_applied="The RR config has been successfully applied. Please restart the NAS to apply the changes."
checking_dependencies_loader="Checking the dependencies..."
file_uploading_failed_msg="Error file uploading."
completed="Completed:"

section_rr_actions="RR Actions"
run_update="Run Update"

frm_validation_fill_required_fields="Please fill in the required field(s)."
frm_validation_no_change="Nothing to save"

0 comments on commit 82a4ded

Please sign in to comment.