Merge pull request #2515 from crazyserver/MOBILE-3548

MOBILE-3548 login: Add the option to easily change site url placeholder
main
Juan Leyva 2020-09-09 16:41:17 +02:00 committed by GitHub
commit 6281ce13fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 3 deletions

View File

@ -258,7 +258,10 @@ function parse_file {
value=`$exec`
guess_file $key "$value"
else
if [ ! -z "$findbetter" ]; then
if [ "$found" == 'donottranslate' ]; then
# Do nothing since is not translatable.
continue
elif [ ! -z "$findbetter" ]; then
exec="jq -r .\"$key\" $1"
value=`$exec`
find_better_file "$key" "$value" "$found"

View File

@ -210,6 +210,18 @@ function build_lang($lang, $keys) {
$string = get_translation_strings($langfoldername, $value->file, $override_langfolder);
// Apply translations.
if (!$string) {
if ($value->file == 'donottranslate') {
// Restore it form the json.
if ($langFile && is_array($langFile) && isset($langFile[$key])) {
$translations[$key] = $langFile[$key];
} else {
// If not present, do not count it in the total.
$total--;
}
continue;
}
if (TOTRANSLATE) {
echo "\n\t\tTo translate $value->string on $value->file";
}
@ -312,6 +324,10 @@ function detect_lang($lang, $keys) {
$string = get_translation_strings($langfoldername, $value->file);
// Apply translations.
if (!$string) {
// Do not count non translatable in the totals.
if ($value->file == 'donottranslate') {
$total--;
}
continue;
}

View File

@ -1833,6 +1833,7 @@
"core.login.signupplugindisabled": "local_moodlemobileapp",
"core.login.signuprequiredfieldnotsupported": "local_moodlemobileapp",
"core.login.siteaddress": "local_moodlemobileapp",
"core.login.siteaddressplaceholder": "donottranslate",
"core.login.sitehasredirect": "local_moodlemobileapp",
"core.login.siteinmaintenance": "local_moodlemobileapp",
"core.login.sitepolicynotagreederror": "local_moodlemobileapp",

View File

@ -1833,6 +1833,7 @@
"core.login.signupplugindisabled": "{{$a}} is not enabled.",
"core.login.signuprequiredfieldnotsupported": "The signup form contains a required custom field that isn't supported in the app. Please create your account using a web browser.",
"core.login.siteaddress": "Your site",
"core.login.siteaddressplaceholder": "https://campus.example.edu",
"core.login.sitehasredirect": "Your site contains at least one HTTP redirect. The app cannot follow redirects, this could be the issue that's preventing the app from connecting to your site.",
"core.login.siteinmaintenance": "Your site is in maintenance mode",
"core.login.sitepolicynotagreederror": "Site policy not agreed.",

View File

@ -104,6 +104,7 @@
"signupplugindisabled": "{{$a}} is not enabled.",
"signuprequiredfieldnotsupported": "The signup form contains a required custom field that isn't supported in the app. Please create your account using a web browser.",
"siteaddress": "Your site",
"siteaddressplaceholder": "https://campus.example.edu",
"sitehasredirect": "Your site contains at least one HTTP redirect. The app cannot follow redirects, this could be the issue that's preventing the app from connecting to your site.",
"siteinmaintenance": "Your site is in maintenance mode",
"sitepolicynotagreederror": "Site policy not agreed.",

View File

@ -20,13 +20,13 @@
<ng-container *ngIf="siteSelector == 'url'">
<ion-item>
<ion-label stacked><h2>{{ 'core.login.siteaddress' | translate }}</h2></ion-label>
<ion-input name="url" type="url" placeholder="https://campus.example.edu" formControlName="siteUrl" [core-auto-focus]="showKeyboard && !showScanQR"></ion-input>
<ion-input name="url" type="url" placeholder="{{ 'core.login.siteaddressplaceholder' | translate }}" formControlName="siteUrl" [core-auto-focus]="showKeyboard && !showScanQR"></ion-input>
</ion-item>
</ng-container>
<ng-container *ngIf="siteSelector != 'url'">
<ion-item>
<ion-label stacked><h2>{{ 'core.login.siteaddress' | translate }}</h2></ion-label>
<ion-input name="url" placeholder="https://campus.example.edu" formControlName="siteUrl" [core-auto-focus]="showKeyboard && !showScanQR" (ionChange)="searchSite($event, siteForm.value.siteUrl)"></ion-input>
<ion-input name="url" placeholder="{{ 'core.login.siteaddressplaceholder' | translate }}" formControlName="siteUrl" [core-auto-focus]="showKeyboard && !showScanQR" (ionChange)="searchSite($event, siteForm.value.siteUrl)"></ion-input>
</ion-item>
<ion-list [class.hidden]="!hasSites && !enteredSiteUrl" class="core-login-site-list">