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

Language file extension not recognized by Grav 1.7? #3147

Closed
kees-closed opened this issue Jan 13, 2021 · 4 comments
Closed

Language file extension not recognized by Grav 1.7? #3147

kees-closed opened this issue Jan 13, 2021 · 4 comments
Assignees

Comments

@kees-closed
Copy link

kees-closed commented Jan 13, 2021

Software in use

  • CentOS 7
  • PHP 7.4 (Plesk)
  • Admin Panel v1.10.0-rc.20
  • Grav v1.7.0-rc.20

Issue description

After upgrading from Grav v1.6.31 to v1.7.0-rc.20 I noticed that in the Admin Panel I'm not able to see and edit the content of the pages anymore. The title and content fields are blank. The pages however are rendered in a browser. When I change the title and content fields with random text it is saved. But it does not replace the content when I refresh the browser. So the files are not overwritten. This is because it saves the new content in e.g. default.md, while the actual content is in default.nl.md.

When I disable the NL language as the default, the content becomes visible and editable as it was in Grav 1.6. Am I missing something here? The documentation for 1.7 doesn't seem to be any different. The file extension for the language such as nl or fr are still in use.

A snippet from my system.yml:

languages:
  supported:
    - nl
  default_lang: nl
  include_default_lang: false
  include_default_lang_file_extension: true
  translations: true
  translations_fallback: true
  session_store_active: false
  http_accept_language: false
  override_locale: true
  content_fallback: {  }
  pages_fallback_only: false

Workaround

A workaround to get things working in the admin panel is to rename all the files without the language file extension. I did this with this command: find user/pages/ -name "*\.md" -type f -exec rename -v .nl.md .md {} +
Which finds all files with the .md extenstion and renames all those files that have .nl.md to .md. Hence removing the Dutch language extension.

After that I'm able to see and edit the files as before. Also clear the language settings in Configuration --> Languages.

@mahagr
Copy link
Member

mahagr commented Jan 15, 2021

@mahagr
Copy link
Member

mahagr commented Jan 15, 2021

As a workaround, add another language to the list and admin starts working.

I wouldn't rename the files unless you want to set include_default_lang_file_extension: false, otherwise you end up having two different file extensions.

@NicoHood
Copy link
Contributor

NicoHood commented Jan 15, 2021

The workaround helps, thanks!

I have set include_default_lang_file_extension: false but grav 1.6 still created files ending with .de. What is the suggested solution now?

@mahagr
Copy link
Member

mahagr commented Jan 15, 2021

It's a new feature in Grav 1.7. In Grav 1.6 if you enabled multi-language support... Yeah, not ideal.

@mahagr mahagr closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants