Localization, not enabling.

This discussion is related to the SphinxSearch addon.

Can't seem to get the locale strings to change, despite changing them.

Comments

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    Are you talking about the ones that are in the sphinx plugin folder? Where are you changing them?

  • AnonymooseAnonymoose ✭✭
    edited November 2012

    Yes, I have edited plugins/SphinxSearch/locale/en-US.php but nothing changes on the site. (I use a custom default locale with en-US as the Locale var.)

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    That's odd, it worked for me. I just now modified $Definition['Related Threads'] = 'Related Threads' and I saw the changes take effect. Are you sure that the array at the top of the file corresponds to 'en-US' and NOT 'en-CA'?

  • @mcu_hq said:
    That's odd, it worked for me. I just now modified $Definition['Related Threads'] = 'Related Threads' and I saw the changes take effect. Are you sure that the array at the top of the file corresponds to 'en-US' and NOT 'en-CA'?

    Yes.

       'Locale'       => 'en-US',
       'Name'         => 'SphinxSearch',
       'Description'  => 'For the Sphinx Search plugin',
       'Version'      => '1.0',
       'Author'       => "mcuhq",
       'AuthorEmail'  => 'mcuhq',
       'AuthorUrl'    => 'http://mcuhq.com',
       'License'      => 'FREE as in BEER'
    

    My locale:

    $LocaleInfo['Custom'] = array (
      'Locale' => 'en-US',
      'Name' => 'Custom',
    
  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭
    edited November 2012

    is the name of the file en-US.php?

  • @mcu_hq said:
    is the name of the file en-US.php?

    Yes.

  • AnonymooseAnonymoose ✭✭
    edited November 2012

    conf/config.php

    // Garden
    $Configuration['Garden']['Locale'] = 'en-US';
    // EnabledLocales
    $Configuration['EnabledLocales']['Custom'] = 'en-US';
    
  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    How about if you have copy-paste the definitions from the sphinx locale file into your main one and edit there. That maybe a stop-gap measure for now.

    I still don't know this isn't working. I can't replicate it on my side of things....there's probably a config setting different somewhere...

    Anonymoose
  • AnonymooseAnonymoose ✭✭
    edited November 2012

    @mcu_hq said:
    How about if you have copy-paste the definitions from the sphinx locale file into your main one and edit there. That maybe a stop-gap measure for now.

    Yes, copy-pasting into the main locale file worked.

    I still don't know this isn't working. I can't replicate it on my side of things....there's probably a config setting different somewhere...

    Thanks for looking into this so far & Thanks for the plugin. :)

  • @Anonymoose

    I think you might also try

    creating a directory called

    /SphinxSearch/locale/en-US/definitions.php

    and put your definitions in there. It might work for you.

    not sure if there is a preferred way.

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

  • AnonymooseAnonymoose ✭✭
    edited November 2012

    @peregrine said:
    I think you might also try
    creating a directory called
    /SphinxSearch/locale/en-US/definitions.php

    and put your definitions in there. It might work for you.

    Just tried it. It doesn't work.

  • peregrineperegrine MVP
    edited November 2012

    @Anonymoose

    the order of locales is

     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 
     4 - locale based -      /locales/en-US/definitions.php"
     5 - locale based        /vanilla/locales/en-US/other_definitions.php"
     6-  conf based          /vanilla/conf/locale.php"
     7-  conf - specialized /www/vanilla/conf/locale-en-US.php"
    

    so depending if you have

    $Definition['Related Threads'] = 'My Related Threads'

    in multiple files.

    it will be overruled by the highest number.

    this is how it works on my server.

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

  • AnonymooseAnonymoose ✭✭
    edited November 2012

    Well, I'll leave it alone, since it works when placed in /vanilla/locales/en-US/other_definitions.php and wait for Vanilla 2.1 to sort it out.

    However, plugins/SphinxSearch/locale/en-US.php does not work. I tried a variety of definitions for a variety of strings.

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    @peregrine do you also see this issue?

  • @mcu_hq said:
    peregrine do you also see this issue?

    I don't have an issue. Your setup and theme changing works perfectly fine in both vanilla1 and vanilla2 creating custom locales on my server. I suspect Anonymoose has incorrectly setup his locales.

    for it to be setup correctly - this is the exact heading he needs.

    $LocaleInfo['locale'] = array( // make sure the key of this array is the same as its folder name.
       'Locale'       => 'en-US',
      ..
    
    
    he probably has it set to 
    $LocaleInfo['Custom']  which would be incorrect in the sphinxplugin
    
    he also needs to delete the .ini files
    
    /cache/
    
    
    -----
    
    But @mcu_hq  you could avoid all this confusion if your plugin didn't use locales in the way you did.
    
    if you create a locale using this technique
    
    
    plugins/SphinxSearch/locale/en-US/definitions.php
    
    then the definitions.php  would not need the $LocaleInfo['locale'] info array.
    
    the definitions.php would just be
    
    <?php if (!defined('APPLICATION')) exit();
    
    $Definition['Related Threads'] = 'US v2 two Related Threads';
    .
    .
    etc.
    

    It might be less confusing for users than the en-CA.php technique and make it less prone for them to make mistakes.

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

  • mcu_hqmcu_hq yippie ki-yay Arizona, USA ✭✭✭

    plugins/SphinxSearch/locale/en-US/definitions.php

    Thanks Peregrine, I'm going to do this for next time.

Sign In or Register to comment.