1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

As Designed Languagemodel::importLanguageXml

Discussion in 'Resolved Bug Reports' started by xf_phantom, Jul 3, 2013.

  1. xf_phantom

    xf_phantom Well-Known Member

    in method importLanguageXml you have following code:
    PHP:
    if ($overwriteLanguageId)
         {
           
    $writer->setExistingData($overwriteLanguageId);
         }
         else
         {
           
    $writer->set('title', (string)$document['title']);
           
    $writer->set('parent_id'$parentLanguageId);
         }

         
    $textDirection = (string)$document['text_direction'];

         
    $writer->bulkSet(array(
           
    'date_format' => (string)$document['date_format'],
           
    'time_format' => (string)$document['time_format'],
           
    'decimal_point' => (string)$document['decimal_point'],
           
    'thousands_separator' => (string)$document['thousands_separator'],
           
    'language_code' => (string)$document['language_code'],
           
    'text_direction' => ($textDirection $textDirection 'LTR')
         ))
    I've changed some of the language data on my installation, but on each addon language import, they're getting overwriten again (with the original data from the language from the translator installation).

    Is it really necessary to run the bulkSet if you overwrite the language?
    Couldn't you drop this?:D
     
    Last edited: Jul 3, 2013
  2. Mike

    Mike XenForo Developer Staff Member

    Looks like this got moved to bugs. It's really just a decision to make - either way could be considered correct. You could always create a child language if you prefer.
     
  3. xf_phantom

    xf_phantom Well-Known Member

    Yea, i reported to move this to bugs because it's really a bad situation => non userdefined data(like the language settingd) should be replaced by an addon or addon translation without an confirmation or at least a notice, so the people know that they should verify the language settings after each import....
     
  4. xf_phantom

    xf_phantom Well-Known Member

    Yes, this is the current workaround, but more languages & more styles => higher chance for cache rebuild problems in the xenforo pre 1.2 era:p (not sure how's the performance with the new system in 1.2)

    that's why i never prefered to have so many languages and different styles:/
     
    Last edited: Jul 3, 2013
  5. xf_phantom

    xf_phantom Well-Known Member

    The problem with the child languages is also:
    3 languages + child language => 6 available languages (7 in debugmode)
    and here's the biggest problem, that the admin can't define which language is selectable for users and which not (like with styles)
     

Share This Page