MOBILE-3039 lang: Fix ratings lang index

main
Pau Ferrer Ocaña 2019-05-29 11:03:02 +02:00
parent af53d44c03
commit 76f470effd
3 changed files with 19 additions and 11 deletions

View File

@ -485,7 +485,7 @@
"addon.mod_forum.addanewquestion": "forum", "addon.mod_forum.addanewquestion": "forum",
"addon.mod_forum.addanewtopic": "forum", "addon.mod_forum.addanewtopic": "forum",
"addon.mod_forum.addtofavourites": "forum", "addon.mod_forum.addtofavourites": "forum",
"addon.mod_forum.advanced": "forum", "addon.mod_forum.advanced": "moodle",
"addon.mod_forum.cannotadddiscussion": "forum", "addon.mod_forum.cannotadddiscussion": "forum",
"addon.mod_forum.cannotadddiscussionall": "forum", "addon.mod_forum.cannotadddiscussionall": "forum",
"addon.mod_forum.cannotcreatediscussion": "forum", "addon.mod_forum.cannotcreatediscussion": "forum",
@ -1645,14 +1645,14 @@
"core.question.questionno": "question", "core.question.questionno": "question",
"core.question.requiresgrading": "question", "core.question.requiresgrading": "question",
"core.quotausage": "moodle", "core.quotausage": "moodle",
"core.rating.aggregateavg": "moodle", "core.rating.aggregateavg": "rating",
"core.rating.aggregatecount": "moodle", "core.rating.aggregatecount": "rating",
"core.rating.aggregatemax": "moodle", "core.rating.aggregatemax": "rating",
"core.rating.aggregatemin": "moodle", "core.rating.aggregatemin": "rating",
"core.rating.aggregatesum": "moodle", "core.rating.aggregatesum": "rating",
"core.rating.noratings": "moodle", "core.rating.noratings": "rating",
"core.rating.rating": "moodle", "core.rating.rating": "rating",
"core.rating.ratings": "moodle", "core.rating.ratings": "rating",
"core.redirectingtosite": "local_moodlemobileapp", "core.redirectingtosite": "local_moodlemobileapp",
"core.refresh": "moodle", "core.refresh": "moodle",
"core.remove": "moodle", "core.remove": "moodle",

View File

@ -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. // Set languages to do. If script is called using a language it will be used as unique.
if (isset($argv[1]) && !empty($argv[1])) { if (isset($argv[1]) && !empty($argv[1])) {
$forcedetect = false; $forcedetect = false;
define('TOTRANSLATE', true);
$languages = explode(',', $argv[1]); $languages = explode(',', $argv[1]);
} else { } else {
$forcedetect = true; $forcedetect = true;
define('TOTRANSLATE', false);
$languages = $config_langs; $languages = $config_langs;
} }
@ -160,6 +162,9 @@ function build_lang($lang, $keys, $total) {
$file = LANGPACKSFOLDER.'/'.$langfoldername.'/'.$value->file.'.php'; $file = LANGPACKSFOLDER.'/'.$langfoldername.'/'.$value->file.'.php';
// Apply translations. // Apply translations.
if (!file_exists($file)) { if (!file_exists($file)) {
if (TOTRANSLATE) {
echo "\n\t\To translate $value->string on $value->file";
}
continue; continue;
} }
@ -169,7 +174,7 @@ function build_lang($lang, $keys, $total) {
if (!isset($string[$value->string])) { if (!isset($string[$value->string])) {
// Not yet translated. Do not override. // Not yet translated. Do not override.
if (!$langFile) { if (!$langFile) {
// Load lang fils just once. // Load lang files just once.
$langFile = file_get_contents(ASSETSPATH.$lang.'.json'); $langFile = file_get_contents(ASSETSPATH.$lang.'.json');
$langFile = (array) json_decode($langFile); $langFile = (array) json_decode($langFile);
} }
@ -177,6 +182,9 @@ function build_lang($lang, $keys, $total) {
$translations[$key] = $langFile[$key]; $translations[$key] = $langFile[$key];
$local++; $local++;
} }
if (TOTRANSLATE) {
echo "\n\t\tTo translate $value->string on $value->file";
}
continue; continue;
} else { } else {
$text = $string[$value->string]; $text = $string[$value->string];

View File

@ -342,7 +342,7 @@ export class AddonModForumDiscussionPage implements OnDestroy {
this.accessInfo = {}; this.accessInfo = {};
}).then(() => { }).then(() => {
this.defaultSubject = this.translate.instant('addon.mod_forum.re') + ' ' + this.defaultSubject = this.translate.instant('addon.mod_forum.re') + ' ' +
(this.discussion ? this.discussion.subject : ""); (this.discussion ? this.discussion.subject : '');
this.replyData.subject = this.defaultSubject; this.replyData.subject = this.defaultSubject;
const startingPost = this.forumProvider.extractStartingPost(posts); const startingPost = this.forumProvider.extractStartingPost(posts);