diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-07 14:13:37 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-07 14:13:37 +0200 |
commit | 6eefea1bb65897b0a1cf8668b15998a12ae197b9 (patch) | |
tree | e0ac1c576243eb55f4865e8067c247d9f60cddda | |
parent | be9b685926c3a9fd899755d99445623f886f2d8f (diff) | |
parent | a5a48ae65c9db6016d5547287d80b115f2c6883d (diff) | |
download | nextcloud-server-6eefea1bb65897b0a1cf8668b15998a12ae197b9.tar.gz nextcloud-server-6eefea1bb65897b0a1cf8668b15998a12ae197b9.zip |
Merge pull request #23806 from owncloud/multiline-javascript-strings-for-translations
Also use Javascript as language in l10n.pl - fixes #13924
-rw-r--r-- | apps/files_external/js/settings.js | 12 | ||||
-rw-r--r-- | apps/files_external/templates/settings.php | 8 | ||||
-rw-r--r-- | l10n/l10n.pl | 19 |
3 files changed, 27 insertions, 12 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 0b33458bec2..55c12cc0ac9 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -34,17 +34,7 @@ var MOUNT_OPTIONS_DROPDOWN_TEMPLATE = ' </select>' + ' </div>' + '</div>'; - - /* TODO the current l10n extrator can't handle JS functions within handlebar - templates therefore they are duplicated here - t("files_external", "Enable encryption") - t("files_external", "Enable previews") - t("files_external", "Enable sharing") - t("files_external", "Check for changes") - t("files_external", "Never") - t("files_external", "Once every direct access") - */ - + /** * Returns the selection of applicable users in the given configuration row * diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index feccd2a4e45..7edd66fe4d5 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -3,11 +3,19 @@ use \OCA\Files_External\Lib\DefinitionParameter; use \OCA\Files_External\Service\BackendService; + $l->t("Enable encryption"); + $l->t("Enable previews"); + $l->t("Enable sharing"); + $l->t("Check for changes"); + $l->t("Never"); + $l->t("Once every direct access"); + script('files_external', 'settings'); style('files_external', 'settings'); // load custom JS foreach ($_['backends'] as $backend) { + /** @var Backend $backend */ if ($backend->getCustomJs()) { script('files_external', $backend->getCustomJs()); } diff --git a/l10n/l10n.pl b/l10n/l10n.pl index 0ff25944d6c..3f50ec0756b 100644 --- a/l10n/l10n.pl +++ b/l10n/l10n.pl @@ -74,6 +74,23 @@ sub getPluralInfo { return $info; } +sub init() { + # let's get the version from stdout of xgettext + my $out = `xgettext --version`; + # we assume the first line looks like this 'xgettext (GNU gettext-tools) 0.19.3' + $out = substr $out, 29, index($out, "\n")-29; + $out =~ s/^\s+|\s+$//g; + $out = "v" . $out; + my $actual = version->parse($out); + # 0.18.3 introduced JavaScript as a language option + my $expected = version->parse('v0.18.3'); + if ($actual < $expected) { + die( "Minimum expected version of xgettext is " . $expected . ". Detected: " . $actual ); + } +} + +init(); + my $task = shift( @ARGV ); my $place = '..'; @@ -117,7 +134,7 @@ if( $task eq 'read' ){ else{ $keywords = '--keyword=t --keyword=n:1,2'; } - my $language = ( $file =~ /\.js$/ ? 'Python' : 'PHP'); + my $language = ( $file =~ /\.js$/ ? 'Javascript' : 'PHP'); my $joinexisting = ( -e $output ? '--join-existing' : ''); print " Reading $file\n"; `xgettext --output="$output" $joinexisting $keywords --language=$language "$file" --add-comments=TRANSLATORS --from-code=UTF-8 --package-version="8.0.0" --package-name="ownCloud Core" --msgid-bugs-address="translations\@owncloud.org"`; |