From 76f470effd58ebaf5dafcb5fa2336453b7da7c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 29 May 2019 11:03:02 +0200 Subject: [PATCH] MOBILE-3039 lang: Fix ratings lang index --- scripts/langindex.json | 18 +++++++++--------- scripts/moodle_to_json.php | 10 +++++++++- .../mod/forum/pages/discussion/discussion.ts | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/scripts/langindex.json b/scripts/langindex.json index bc3172875..7381c6fc8 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -485,7 +485,7 @@ "addon.mod_forum.addanewquestion": "forum", "addon.mod_forum.addanewtopic": "forum", "addon.mod_forum.addtofavourites": "forum", - "addon.mod_forum.advanced": "forum", + "addon.mod_forum.advanced": "moodle", "addon.mod_forum.cannotadddiscussion": "forum", "addon.mod_forum.cannotadddiscussionall": "forum", "addon.mod_forum.cannotcreatediscussion": "forum", @@ -1645,14 +1645,14 @@ "core.question.questionno": "question", "core.question.requiresgrading": "question", "core.quotausage": "moodle", - "core.rating.aggregateavg": "moodle", - "core.rating.aggregatecount": "moodle", - "core.rating.aggregatemax": "moodle", - "core.rating.aggregatemin": "moodle", - "core.rating.aggregatesum": "moodle", - "core.rating.noratings": "moodle", - "core.rating.rating": "moodle", - "core.rating.ratings": "moodle", + "core.rating.aggregateavg": "rating", + "core.rating.aggregatecount": "rating", + "core.rating.aggregatemax": "rating", + "core.rating.aggregatemin": "rating", + "core.rating.aggregatesum": "rating", + "core.rating.noratings": "rating", + "core.rating.rating": "rating", + "core.rating.ratings": "rating", "core.redirectingtosite": "local_moodlemobileapp", "core.refresh": "moodle", "core.remove": "moodle", diff --git a/scripts/moodle_to_json.php b/scripts/moodle_to_json.php index 2eccc8c1d..2abf2a6c2 100644 --- a/scripts/moodle_to_json.php +++ b/scripts/moodle_to_json.php @@ -34,9 +34,11 @@ $config_langs = array_keys(get_object_vars($config['languages'])); // Set languages to do. If script is called using a language it will be used as unique. if (isset($argv[1]) && !empty($argv[1])) { $forcedetect = false; + define('TOTRANSLATE', true); $languages = explode(',', $argv[1]); } else { $forcedetect = true; + define('TOTRANSLATE', false); $languages = $config_langs; } @@ -160,6 +162,9 @@ function build_lang($lang, $keys, $total) { $file = LANGPACKSFOLDER.'/'.$langfoldername.'/'.$value->file.'.php'; // Apply translations. if (!file_exists($file)) { + if (TOTRANSLATE) { + echo "\n\t\To translate $value->string on $value->file"; + } continue; } @@ -169,7 +174,7 @@ function build_lang($lang, $keys, $total) { if (!isset($string[$value->string])) { // Not yet translated. Do not override. if (!$langFile) { - // Load lang fils just once. + // Load lang files just once. $langFile = file_get_contents(ASSETSPATH.$lang.'.json'); $langFile = (array) json_decode($langFile); } @@ -177,6 +182,9 @@ function build_lang($lang, $keys, $total) { $translations[$key] = $langFile[$key]; $local++; } + if (TOTRANSLATE) { + echo "\n\t\tTo translate $value->string on $value->file"; + } continue; } else { $text = $string[$value->string]; diff --git a/src/addon/mod/forum/pages/discussion/discussion.ts b/src/addon/mod/forum/pages/discussion/discussion.ts index 2d6b9af79..f8514dd5f 100644 --- a/src/addon/mod/forum/pages/discussion/discussion.ts +++ b/src/addon/mod/forum/pages/discussion/discussion.ts @@ -342,7 +342,7 @@ export class AddonModForumDiscussionPage implements OnDestroy { this.accessInfo = {}; }).then(() => { this.defaultSubject = this.translate.instant('addon.mod_forum.re') + ' ' + - (this.discussion ? this.discussion.subject : ""); + (this.discussion ? this.discussion.subject : ''); this.replyData.subject = this.defaultSubject; const startingPost = this.forumProvider.extractStartingPost(posts);