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

Problems with multilanguage disabled and standard language german #3938

Closed
Portugao opened this issue Nov 5, 2018 · 7 comments · Fixed by #4235
Closed

Problems with multilanguage disabled and standard language german #3938

Portugao opened this issue Nov 5, 2018 · 7 comments · Fixed by #4235

Comments

@Portugao
Copy link

Portugao commented Nov 5, 2018

Q A
Zikula Version 2.0.11
PHP Version 7.1

Expected behavior

No access to domain/en when multilanguage is disabled and defaullt language is german

Actual behavior

full access to all pages about domain/en/mypage

Steps to reproduce

@Guite Guite added this to the 3.0.0 milestone Nov 5, 2018
@Guite Guite added the Bug label Jan 28, 2019
@craigh
Copy link
Member

craigh commented Apr 9, 2020

@Portugao to clarify - you only have one active language (German). Did you remove all en translations (including routes)?

@Guite
Copy link
Member

Guite commented Apr 10, 2020

The point is that if multilingual is set to disabled the core should only accept requests for the default language.

There are reasons to have other locales in file system (for example in a Multisites setup, see #3781, or simply for development purpose).

Also, it feels a bit like a hack to remove files that were included in the official core download. At the moment this affects only en. But also other translations are going to be added to the core after zk3 has been released because we decided to get rid of the (dead) communities repositories (see docs).

@craigh
Copy link
Member

craigh commented Apr 10, 2020

Is it possible this is simply a cache problem? was the cache cleared after the settings were changed? If I am to try to fix this I will require a working translation please.

@Guite
Copy link
Member

Guite commented Apr 10, 2020

From looking at how LocaleApi works I think it should recognise a locale as soon as at least one file for it exists in translations/. So you could for example just touch translations/foo.de.yaml to let the system detect German as available.

@Guite
Copy link
Member

Guite commented Apr 10, 2020

You can also use German po files for 2.0.x from https://github.com/zikula-communities/german/tree/core-2.0/app/Resources/translations and put them into translations/.

@craigh
Copy link
Member

craigh commented Apr 10, 2020

THIS COMMENT WAS HEAVILY EDITED 🗡️ 😄

what was the settings for locales in your setup at the time?

jms_i18n_routing:
    default_locale: en
    locales: [en]
    strategy: prefix_except_default

it would be in your generated.yml file but look like this one from the default file.

craigh added a commit that referenced this issue Apr 10, 2020
…d. (#4235)

* remove non-default languages from config when multilingual is disabled.
fixes #3938
@craigh
Copy link
Member

craigh commented Apr 10, 2020

@Portugao this is fixed for v3.0.0 but I don't think the fix can be back ported to 2.0.x because most of the modified code is new in v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants