[stable8.2] Read available l10n files also from theme folder #23571

Merged
merged 1 commit into from Jun 1, 2016

Projects

None yet

7 participants

@MorrisJobke
Member

The old behaviour was that only languages could be used for an app
that are already present in the apps/$app/l10n folder. If there is
a themed l10n that is not present in the apps default l10n folder
the language could not be used and the texts are not translated.

With this change this is possible and also the l10n files are
loaded even if the default l10n doesn't contain the l10n file.

Stable8.2 version of #23362

Approval in #23362 (comment)

I tested this and it works fine :) I need to remove the tests as this is the static code stuff that was refactored for 9.0

@MorrisJobke MorrisJobke Read available l10n files also from theme folder
The old behaviour was that only languages could be used for an app
that are already present in the apps/$app/l10n folder. If there is
a themed l10n that is not present in the apps default l10n folder
the language could not be used and the texts are not translated.

With this change this is possible and also the l10n files are
loaded even if the default l10n doesn't contain the l10n file.
f24f3b1
@MorrisJobke MorrisJobke added this to the 8.2.4-current-maintenance milestone Mar 24, 2016
@mention-bot

By analyzing the blame information on this pull request, we identified @AndreasErgenzinger, @DeepDiver1975 and @LukasReschke to be potential reviewers

@LukasReschke
Member

👍

@nickvergessen
Contributor

Does not work for me on stable8.2

I copied the activity/l10n/de* files to the theme and they are not found by findLanguage() and therefor it falls back to english:
https://github.com/owncloud/core/blob/f24f3b1bb94bf4fdc6307f2b70add26c81c50230/lib/private/l10n.php#L508-L517

@MorrisJobke
Member

I copied the activity/l10n/de* files to the theme and they are not found by findLanguage() and therefor it falls back to english:

Really? I tested this multiple times ... I will investigate

@MorrisJobke MorrisJobke self-assigned this Apr 5, 2016
@PVince81
Collaborator

Any update ?

@MorrisJobke
Member

Any update ?

Not yet. I need to find a free time slot to work on this later.

@PVince81
Collaborator

@MorrisJobke what's the severity ? If it's not critical we can move this to 8.2.5 then.

@michaelstingl

@MorrisJobke @PVince81 I guess this means 8.2.6 now?

@PVince81
Collaborator

Yes, the milestone got updated now

@PVince81
Collaborator

@MorrisJobke any chance to fix this backport ? Were you able to reproduce the issues ?

@PVince81
Collaborator
PVince81 commented Jun 1, 2016

I can't seem to find the test instructions any more.

@PVince81
Collaborator
PVince81 commented Jun 1, 2016

This is what I tried:

  1. Edit "config.php" and set "theme" to "example"
  2. Create folder "themes/example/apps/activity/l10n"
  3. Copy "apps/activity/l10n/fr*" to "themes/example/apps/activity/l10n"
  4. Set the language to french in the personal page
  5. Edit the "fr*" files and replace the text "Activité" with "Hacktivité"
  6. Clear browser cache and cookies
  7. Log in again
  8. Go to activity app and check the title

Expected: title becomes "Hacktivité"
Actual: title is still "Activité".

@PVince81
Collaborator
PVince81 commented Jun 1, 2016

Tried the same on stable9 where the backport was already merge and it does not work.

But if @MorrisJobke said it works then there's probably a misunderstanding in the test steps ?
Please clarify.

@PVince81
Collaborator
PVince81 commented Jun 1, 2016

Okay, I didn't test this properly.

Actually my folder is "apps3/activity" so I had to also rename it in the themes folder "themes/example/apps3/activity/l10n/fr*".

Now it works 👍

@PVince81 PVince81 merged commit c125776 into stable8.2 Jun 1, 2016

22 of 23 checks passed

core-ci-linux-swift-primary-storage/database=mysql,label=SLAVE Build #54003 failed in 22 sec
Details
Scrutinizer 3 new issues, 4 updated code elements
Details
cla-bot-core Build #2650 succeeded in 15 sec
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
core-ci-linux-jsunit/database=sqlite,label=SLAVE Build #60007 succeeded in 19 sec
Details
core-ci-linux/database=mysql,label=SLAVE Build #28566 succeeded in 8 min 51 sec
Details
core-ci-linux/database=oci,label=SLAVE Build #28566 succeeded in 19 min
Details
core-ci-linux/database=pgsql,label=SLAVE Build #28566 succeeded in 8 min 45 sec
Details
core-ci-linux/database=sqlite,label=SLAVE Build #28566 succeeded in 4 min 30 sec
Details
ocs-api-integration-tests-ci Build #8912 succeeded in 28 sec
Details
server-master-linux-externals-ci/database=sqlite,external=smb-silvershell,label=SLAVE Build #8683 succeeded in 1 min 12 sec
Details
server-master-linux-externals-ci/database=sqlite,external=swift-ceph,label=SLAVE Build #8683 succeeded in 43 sec
Details
server-master-linux-externals-ci/database=sqlite,external=webdav-ownCloud,label=SLAVE Build #8683 succeeded in 2 min 52 sec
Details
server-master-linux-externals-smb-windows-ext-ci/database=sqlite,external=smb-windows,label=master Build #9531 succeeded in 2 min 36 sec
Details
server-master-linux-php5.4-ci/database=sqlite,label=SLAVE Build #1379 succeeded in 3 min 16 sec
Details
server-master-linux-php7-ci/database=sqlite,label=SLAVE Build #36824 succeeded in 1 min 54 sec
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=litmus,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 7 min 57 sec
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_basicSync@0,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 39 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_basicSync@1,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 37 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_shareLink,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 23 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePermissions,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 35 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePropagationGroups,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 15 min
Details
smashbox-on-docker-ci/DOCKER_IMAGE=ubuntu_oc_lamp-git,TEST_NAME=test_sharePropagationInsideGroups,mirallBranch=v2.0.2,slave=SMASH Build #13026 succeeded in 12 min
Details
@PVince81 PVince81 deleted the stable8.2-backport-23362 branch Jun 1, 2016
@MorrisJobke MorrisJobke removed their assignment Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment