Giter Site home page Giter Site logo

Comments (4)

Martimiz avatar Martimiz commented on August 14, 2024

Hmm that's strange... I'll try and reproduce it. Would be great if you could look into it as well if you have the time that is :)

Btw: which version of LanguagePrefix and Translatable are you using?

from silverstripe-languageprefix.

Martimiz avatar Martimiz commented on August 14, 2024

I'm sorry, I couldn't reproduce this problem.

Below is what I did. I also added the settings I used - which are almost the same as yours, the only thing different is en_AU in the prefix map instead of en_CA, because I had created Australian translations instead of Canadian :)

I did the following:

  • composer create-project silverstripe/installer www
  • composer require silverstripe/translatable 2.2.0
  • composer require martimiz/silverstripe-languageprefix v3.0.0
  • add the _config.php settings
  • dev/build?flush
  • add the config.yml settings
  • ?flush=all
  • created en_AU translations
  • tested homepage www/mysite.dev/ and www/mysite.dev/au/ -> both found == ok
  • tested www/mysite.dev/en_GB/ -> not found == ok
  • tested other translations -> ok
i18n::set_locale('en_GB');
Translatable::set_default_locale('en_GB');
i18n:
  common_locales:
    en_CA: 
      name: 'English (Canada)'
      native: 'English (Canada)'
    en_AU: 
      name: 'English (Australia)'
      native: 'English (Australia)'
Translatable:
  enforce_global_unique_urls: false
---
Name: languageprefix-config
---
prefixconfig:
  locale_prefix_map:
    # 'en_GB': uk
    'en_US': us
    'en_AU': au
  enable_duplicate_urlsegments: true
  disable_prefix_for_default_lang: true

from silverstripe-languageprefix.

thezenmonkey avatar thezenmonkey commented on August 14, 2024

I think I figured it out. I set up the other English versions before I enabled 'enable_duplicate_urlsegments' so the default en-GB urlSegment was home, while the the en-US was home-en-us.

For some reason when going to the home page it was trying to find home-en-us with a Locale of en-GB. Once I switch the en-US sefment to home it worked. I'm not sure if it was a browser setting making it lok for the US version or somethin else.

from silverstripe-languageprefix.

Martimiz avatar Martimiz commented on August 14, 2024

That's a bit too complex to duplicate... :)

Anyway: the URLSegment link in the CMS should always tell you how the link for each page is constructed, and clicking it should lead you to the right page...

If you ever find a situation where that link is incorrect or doesn't lead to the right page or isn't equal to the link that is constructed on the frontend, let me know, including settings and urls.

For now I'll close this issue.

from silverstripe-languageprefix.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.