Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions translations/translationtool/tests/expected.pot
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the Nextcloud package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""

#. TRANSLATORS PHP string with plain text
#: lib/php.php:12
msgid "PHP String"
Expand All @@ -24,22 +15,33 @@ msgstr ""
msgid "PHP String with positional %1$s"
msgstr ""

#. TRANSLATORS PHP trailing WITH dot after parameter
#: lib/php.php:20
#, php-format
msgid "PHP String with positional %1$s."
msgstr ""

#. TRANSLATORS PHP trailing WITH dot after fake-parameter
#: lib/php.php:24
msgid "PHP String with positional {param}."
msgstr ""

#. TRANSLATORS PHP plural with plain text
#: lib/php.php:21
#: lib/php.php:29
msgid "PHP %n Plural"
msgid_plural "PHP %n Plurals"
msgstr[0] ""
msgstr[1] ""

#. TRANSLATORS PHP plural with parameters
#: lib/php.php:23
#: lib/php.php:31
msgid "PHP %n Plural with %s"
msgid_plural "PHP %n Plurals with %s"
msgstr[0] ""
msgstr[1] ""

#. TRANSLATORS PHP plural with positional parameters
#: lib/php.php:27
#: lib/php.php:35
msgid "PHP %n Plural with positional %1$s"
msgid_plural "PHP %n Plurals with positional %1$s"
msgstr[0] ""
Expand Down Expand Up @@ -128,22 +130,33 @@ msgstr ""
msgid "JS String with wrapped {parameter}"
msgstr ""

#. TRANSLATORS JS trailing WITHOUT dot after parameter
#: src/js.js:15
msgid "Failed to rename {currentCollectionFileName} to {newCollectionFileName}"
msgstr ""

#. TRANSLATORS JS trailing WITH dot after parameter
#: src/js.js:19
msgid ""
"Failed to rename {currentCollectionFileName} to {newCollectionFileName}."
msgstr ""

#. TRANSLATORS JS plural with plain text
#: src/js.js:16
#: src/js.js:24
msgid "JS %n Plural"
msgid_plural "JS %n Plurals"
msgstr[0] ""
msgstr[1] ""

#. TRANSLATORS JS plural with parameters
#: src/js.js:18
#: src/js.js:26
msgid "JS %n Plural with %s"
msgid_plural "JS %n Plurals with %s"
msgstr[0] ""
msgstr[1] ""

#. TRANSLATORS JS plural with wrapped parameters
#: src/js.js:20
#: src/js.js:28
msgid "JS %n Plural with wrapped %s"
msgid_plural "JS %n Plurals with wrapped %s"
msgstr[0] ""
Expand Down
8 changes: 8 additions & 0 deletions translations/translationtool/tests/lib/php.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
$l->t('PHP String with positional %1$s', [
'Parameter',
]);
// TRANSLATORS PHP trailing WITH dot after parameter
$l->t('PHP String with positional %1$s.', [
'Parameter',
]);
// TRANSLATORS PHP trailing WITH dot after fake-parameter
$l->t('PHP String with positional {param}.', [
'Parameter',
]);

// TRANSLATORS PHP plural with plain text
$l->n('PHP %n Plural', 'PHP %n Plurals', 6);
Expand Down
8 changes: 8 additions & 0 deletions translations/translationtool/tests/src/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ t('test', 'JS String with inline {parameter}', { parameter: 'Parameter' });
t('test', 'JS String with wrapped {parameter}', {
parameter: 'Parameter',
});
// TRANSLATORS JS trailing WITHOUT dot after parameter
t('test', 'Failed to rename {currentCollectionFileName} to {newCollectionFileName}', {
parameter: 'Parameter',
});
// TRANSLATORS JS trailing WITH dot after parameter
t('test', 'Failed to rename {currentCollectionFileName} to {newCollectionFileName}.', {
parameter: 'Parameter',
});

// TRANSLATORS JS plural with plain text
n('test', 'JS %n Plural', 'JS %n Plurals', 6);
Expand Down
7 changes: 5 additions & 2 deletions translations/translationtool/tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
php ../src/translationtool.php create-pot-files

# Remove unstable data like "POT-Creation-Date: 2024-09-10 14:25+0200\n"
# And remove the development path
cat translationfiles/templates/tests.pot | grep -v '^"' | sed -e "s/${PWD//\//\\/}\\///" > expected.pot
cat translationfiles/templates/tests.pot | \
# Remove meta data
tail -n +21 | \
# And remove the development path
sed -e "s/${PWD//\//\\/}\\///" > expected.pot

CHANGED_LINES=$(git diff expected.pot | wc -l)

Expand Down