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

This page has not been translated to Default language yet! No Fallback translations found. #47

Closed
replayshot opened this issue Jan 30, 2020 · 9 comments
Assignees
Labels
enhancement Enhancement for an existing feature fixed Issue has already been fixed

Comments

@replayshot
Copy link

replayshot commented Jan 30, 2020

I have a site in English with no other translations yet ready. When I turn on Flex Pages (Admin) and then go to edit a page, no content from the default.en.md is shown and I get the message: "This page has not been translated to Default language yet! No Fallback translations found."

When I switch from Default to English in Admin, it still shows nothing in the Admin area. The site front end shows up fine.

I assume, this is not an issue, but perhaps you can tell me that I am doing something wrong :).

Using RC3 pre-release.

@mahagr
Copy link
Contributor

mahagr commented Jan 31, 2020

Yes, well, this is still something I'm debating myself and depends on settings.

Basically when you have selected language, it uses:

  • Default: default.md
  • English: default.en.md
  • Finnish: default.fi.md

So basically you are editing different version of the file. The warning is there to prevent you from accidentally editing wrong file. Your default.md may not be English, but your site could still have English as the default fallback. Also, the default language may be used in multiple ways... It could only have common pages to all languages which are automatically translated (blog listing), or it could be used as English fallback on a page. This is because of no fallback means that the page does not exist in a given language.

There are some configuration options to make admin clearer based on what you want; we need to document those.

All of this is confusing, which is why I've been trying to figure out a way to make it easier in admin to understand what's going on.

All good suggestions are welcome. :)

@mahagr mahagr added documentation enhancement Enhancement for an existing feature help wanted Extra attention is needed labels Jan 31, 2020
@replayshot
Copy link
Author

Thanks for the reply.

I can totally imagine that it is tricky to implement:).

So there are a few issues I see:

  1. in my case I only have:

default.en.md - and no content shows up in Admin even if I switch from Default to English. In this case I assume my english file should be pulled in and the contents shown. So that seems like a bug if in Admin I cannot edit my existing default.en.md (even if I go to expert mode, it is empty). The file however exists on server and shows up fine on the web.

  1. assuming the above situation where only one file exists:
    Since default.md does not exist, I should be taken directly to default.en.md (my default language), otherwise, it is quite confusing if I am offered Default as my first choice, even though I do not plan on having default.md, but only default.xx.md.

  2. With the current setup, I get default.md as a first choice with a warning. Then I switch in the pulldown box to English and am taking to default.en.md (assuming it shows up), but then how do I know which file I am editing (apart from /en/ in the url). There is no visual indication in the Admin that I am editing an English file.

  3. If I want to switch back to default, it does nothing and I am stuck in the English variation.

Hope any of this helps.

Otherwise, I think it is quite easy to understand the

@mahagr
Copy link
Contributor

mahagr commented Jan 31, 2020

Can you paste your system configuration file here?

@replayshot
Copy link
Author

replayshot commented Feb 1, 2020

absolute_urls: true
param_sep: ':'
wrapped_site: false
reverse_proxy_setup: false
force_ssl: false
force_lowercase_urls: true
username_regex: '^[a-z0-9_-]{3,16}$'
pwd_regex: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}'
intl_enabled: true
languages:
  supported:
    - en
  include_default_lang: false
  pages_fallback_only: false
  translations: true
  translations_fallback: true
  session_store_active: false
  http_accept_language: false
  override_locale: false
home:
  alias: /p
  hide_in_urls: true
pages:
  theme: quark
  order:
    by: default
    dir: asc
  list:
    count: 20
  dateformat:
    short: 'jS M Y'
    long: 'F jS \a\t g:ia'
  publish_dates: true
  process:
    markdown: true
    twig: false
  twig_first: false
  never_cache_twig: false
  events:
    page: true
    twig: true
  markdown:
    extra: false
    auto_line_breaks: false
    auto_url_links: false
    escape_markup: false
    special_chars:
      '>': gt
      '<': lt
  types:
    - html
    - htm
    - xml
    - txt
    - json
    - rss
    - atom
  expires: 604800
  last_modified: false
  etag: false
  vary_accept_encoding: false
  redirect_default_route: false
  redirect_default_code: '302'
  redirect_trailing_slash: true
  ignore_files:
    - .DS_Store
  ignore_folders:
    - .git
    - .idea
  ignore_hidden: true
  url_taxonomy_filters: true
  frontmatter:
    process_twig: false
    ignore_fields:
      - form
      - forms
cache:
  enabled: false
  check:
    method: file
  driver: auto
  prefix: g
  purge_at: '0 4 * * *'
  clear_at: '0 3 * * *'
  clear_job_type: standard
  clear_images_by_default: true
  cli_compatibility: false
  lifetime: 604800
  gzip: false
  allow_webserver_gzip: false
twig:
  cache: true
  debug: true
  auto_reload: true
  autoescape: false
  undefined_functions: true
  undefined_filters: true
  umask_fix: false
assets:
  css_pipeline: false
  css_pipeline_include_externals: true
  css_pipeline_before_excludes: true
  css_minify: true
  css_minify_windows: false
  css_rewrite: true
  js_pipeline: false
  js_pipeline_include_externals: true
  js_pipeline_before_excludes: true
  js_minify: true
  enable_asset_timestamp: false
  collections:
    jquery: 'system://assets/jquery/jquery-2.x.min.js'
errors:
  display: 1
  log: true
log:
  handler: file
  syslog:
    facility: local6
debugger:
  enabled: true
  shutdown:
    close_connection: true
  twig: true
images:
  default_image_quality: 85
  cache_all: false
  cache_perms: '0755'
  debug: false
  auto_fix_orientation: false
  seofriendly: false
media:
  enable_media_timestamp: false
  auto_metadata_exif: false
  upload_limit: 2097152
session:
  enabled: true
  initialize: true
  timeout: 1800
  name: g-s-themes
  uniqueness: path
  secure: false
  httponly: true
  split: true
gpm:
  releases: stable
  method: auto
  verify_peer: true
  official_gpm_only: true
accounts:
  type: data
  storage: file
strict_mode:
  yaml_compat: true
  twig_compat: false

@mclane
Copy link

mclane commented Feb 11, 2020

same issue here. I have downgraded the admin plugin to 1.9.12.

@mahagr
Copy link
Contributor

mahagr commented Feb 12, 2020

No need to downgrade admin plugin, just go to Flex Objects plugin settings and disable pages there.

@mahagr
Copy link
Contributor

mahagr commented Mar 3, 2020

There was an issue with:

system.yaml

languages:
  include_default_lang_file_extension: false

This was fixed in 38db3d0

@mahagr mahagr added bug Something isn't working fixed Issue has already been fixed and removed help wanted Extra attention is needed fixed Issue has already been fixed labels Mar 3, 2020
@mahagr
Copy link
Contributor

mahagr commented Mar 3, 2020

Umm, there are more cases which should be fixed. :)

@mahagr mahagr self-assigned this Mar 3, 2020
mahagr added a commit that referenced this issue Aug 28, 2020
@mahagr
Copy link
Contributor

mahagr commented Aug 28, 2020

I've simplified the admin to handle correctly the different file formats for the default language. This requires the upcoming RC.16 Grav and plugin updates. I have removed the default language from the admin (except for the popup in list view, which basically represents file extensions) and I'm just using the name of the default language instead.

The feature relays on system.yaml setting:

languages:
  include_default_lang_file_extension: [true|false]

With both settings and assuming that en is the default language, the admin page content will prefer using .en.md file if it exists.

If true, non-existing files will be saved using the language file extension .en.md and notification is being shown if the existing file does not have the language suffix.

if false, non-existing files will be saved using the simple file extension .md and notification is being shown if the existing file has the language suffix.

In both cases, there's a message if both files are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement for an existing feature fixed Issue has already been fixed
Projects
None yet
Development

No branches or pull requests

3 participants