Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 1, 2016

Conversation

@MorrisJobke
Copy link
Contributor

MorrisJobke commented Mar 24, 2016

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

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.
@MorrisJobke MorrisJobke added this to the 8.2.4-current-maintenance milestone Mar 24, 2016
@mention-bot

This comment has been minimized.

Copy link

mention-bot commented Mar 24, 2016

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

@MorrisJobke

This comment has been minimized.

Copy link
Contributor Author

MorrisJobke commented Mar 24, 2016

@MorrisJobke

This comment has been minimized.

Copy link
Contributor Author

MorrisJobke commented Apr 4, 2016

@LukasReschke

This comment has been minimized.

Copy link
Member

LukasReschke commented Apr 4, 2016

👍

@nickvergessen

This comment has been minimized.

Copy link
Contributor

nickvergessen commented Apr 5, 2016

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:

core/lib/private/l10n.php

Lines 508 to 517 in f24f3b1

public static function languageExists($app, $lang) {
if ($lang === 'en') {//english is always available
return true;
}
$dir = self::findI18nDir($app);
if(is_dir($dir)) {
return file_exists($dir.'/'.$lang.'.json');
}
return false;
}

@MorrisJobke

This comment has been minimized.

Copy link
Contributor Author

MorrisJobke commented Apr 5, 2016

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

This comment has been minimized.

Copy link
Member

PVince81 commented Apr 22, 2016

Any update ?

@MorrisJobke

This comment has been minimized.

Copy link
Contributor Author

MorrisJobke commented Apr 22, 2016

Any update ?

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

@PVince81

This comment has been minimized.

Copy link
Member

PVince81 commented Apr 26, 2016

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

@MorrisJobke MorrisJobke modified the milestones: 8.2.5-next-maintenance, 8.2.4-current-maintenance Apr 26, 2016
@michaelstingl

This comment has been minimized.

Copy link

michaelstingl commented May 13, 2016

@MorrisJobke @PVince81 I guess this means 8.2.6 now?

@MorrisJobke MorrisJobke modified the milestones: 8.2.5, 8.2.6-current-maintenance May 17, 2016
@PVince81

This comment has been minimized.

Copy link
Member

PVince81 commented May 17, 2016

Yes, the milestone got updated now

@PVince81

This comment has been minimized.

Copy link
Member

PVince81 commented May 20, 2016

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

@PVince81

This comment has been minimized.

Copy link
Member

PVince81 commented Jun 1, 2016

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

@PVince81

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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
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
@lock

This comment has been minimized.

Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants
You can’t perform that action at this time.