Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Translations 'IN' the Theme Folder?

Hello,

I'm well aware of how to create a locale.php file in "/conf/" but can it be done in the Theme folder?

I am creating a theme and there are a few things I want translated differently than the default sayings.

I want to package the theme with these translations.

Any suggestions or should I simply attach my locale.php modifications for that person to upload themselves?

Would prefer the "less steps" action, but understand if it's the only possibility. Thanks in advance!

Best Answers

Answers

  • Options

    Hi Peregrine,

    Thanks for this. Not sure how I missed that!

  • Options

    Hello,

    Alright, I'm a little lost here so maybe I could get some clarification.

    In the documentation it states create a new folder (in my theme) called "locales" - done.

    I've added in the LocaleKey details as described in the documentation - done.

    Keeping things simple, I named it "en-CA". I've created a file, "en-CA.php" - done.

    It states then go to the Dashboard > Locales and I should be able to enable it then.

    I'm unable to see this here. Obviously I'm missing something super simple but what?

    Sorry for my ignorance here but I've tried all the suggestions to make this work.

    Any advice or what step I could be overlooking or not doing correctly?

  • Options
    peregrineperegrine MVP
    edited March 2014

    $Configuration['Garden']['Locale'] = 'en-CA';

    if your locale is en-CA it is your default locale.

    you will find the en-Ca locale in applications/vanilla/locale

    it is already enabled, vanilla comes with en-Ca locale.

    when changing locales you must delete the locale_map.ini from the /cache folder

    as I pointed out in the links the precedence is as so...

    1 - application based and dashboard based definitions
    2- plugin based - plugins/SphinxSearch/locale/en-US.php"
    plugins/SphinxSearch/locale/en-US/definitions.php
    3 - theme based /themes/YOURTHEMENAME/locale/en-US.php
    4 - locale based - /locales/en-US/definitions.php"
    5 - locale based /vanilla/locales/en-US/other_definitions.php"
    6- conf based conf/locale.php"
    7- conf - specialized /conf/locale-en-US.php"
    

    if you have a definition in themes e.g. /themes/YOURTHEMENAME/locale/en-US.php, it will be overridden by any of these files if the same definition occurs.

    4 - locale based - /locales/en-US/definitions.php"
    5 - locale based /vanilla/locales/en-US/other_definitions.php"
    6- conf based conf/locale.php"
    7- conf - specialized /conf/locale-en-US.php"
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited March 2014

    you can have multiple locales enabled..

    e.g.

    // EnabledLocales
    $Configuration['EnabledLocales']['en-US'] = 'en-US';
    $Configuration['EnabledLocales']['vf_ca_ES'] = 'ca-ES';
    $Configuration['EnabledLocales']['Custom'] = 'custom en-US';
    

    but the default locale you have chosen in dashboard is reflected in config.php e.g.

    $Configuration['Garden']['Locale'] = 'en-CA';

    is the one that is used.

    you could re-read this and see if it helps...

    http://vanillaforums.org/discussion/25641/how-to-tutorial-theme-specific-definitions-mobile-vs-non-mobile

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.