Menu

#199 (in 2.6.0) Fix for zh-cn language detection

closed-accepted
Interface (183)
1
2004-09-27
2004-05-23
Xuefer
No

2 patch

Discussion

  • Xuefer

    Xuefer - 2004-05-23

    patch 1

     
  • Xuefer

    Xuefer - 2004-05-23

    alternative patch

     
  • Michal Čihař

    Michal Čihař - 2004-05-24

    Logged In: YES
    user_id=192186

    What's problem with current detection? Please describe what
    is your patch fixing, without such infomation it can not be
    applied.

     
  • Xuefer

    Xuefer - 2004-05-24

    Logged In: YES
    user_id=185131

    the old detect can't do with:
    zh-cn, zh-sg, zh-***
    u know, there's so many langs which match "[a-zA-Z]{2}(-[a-
    zA-Z]{2})?" in IE
    e.g.:
    en-gb en-cz zh-cn zh-sg
    and the default installtion for ChinaMainlan is "zh-cn", not "zh"

    the 1st patch has smaller changes
    and 2nd patch is recommed, because it would be better
    handled in foreach loop to change regexp so it has "(-[a-zA-Z]
    {2})?"

    'zh|chinese simplified'
    becomes:
    'zh([-_][[:alpha:]]{2})?|chinese simplified'

    'en|english'
    becomes:
    'en([-_][[:alpha:]]{2})?|english'

    it looks that "zh[-_]tw|.." will be affected, but no, it's fine
    because "zh[-_]tw([-_][[:alpha:]]{2})?" still match "zh-tw",
    and won't match "zh-cn" or "zh"

     
  • Michal Čihař

    Michal Čihař - 2004-05-24

    Logged In: YES
    user_id=192186

    Your change requires languages with two vairant - one
    specific (sr-lat) and one generic (sr) to be listed in
    specific order, but seems reasonable to me.

     
  • Xuefer

    Xuefer - 2004-05-24

    Logged In: YES
    user_id=185131

    cos there is a "-" for the mark
    i think
    "(-[[:alpha:]]{2,3})?"
    or "(-[[:alpha:]]{2,})?"
    or "(-[[:alpha:]]+)?"
    all is fine for me, not a serious problem

     
  • Michal Čihař

    Michal Čihař - 2004-05-25
    • assigned_to: nobody --> nijel
     
  • Michal Čihař

    Michal Čihař - 2004-05-25

    Logged In: YES
    user_id=192186

    And one more question: why did you comment out setting
    language from cookie?

     
  • Xuefer

    Xuefer - 2004-05-25

    Logged In: YES
    user_id=185131

    opps~~, very sorry... comment out the cookie is my personal
    private "fix", shouldn't be in the patch :(

    the cookie is conflict with my own one. IMHO, cookies used
    by phpmyadmin should prefix with PMA_, e.g. PMA_lang
    but this is another issue. maybe i should open another RFE? :)

     
  • Michal Čihař

    Michal Čihař - 2004-05-25

    Logged In: YES
    user_id=192186

    I made a bit different patch based on yours, can you test
    whether it will work okay for you?

    About cookie prefix: you're right we use pma prefix on other
    places.

     
  • Michal Čihař

    Michal Čihař - 2004-05-25

    updated patch

     
  • Xuefer

    Xuefer - 2004-05-25

    Logged In: YES
    user_id=185131

    it's fine :)

     
  • Michal Čihař

    Michal Čihař - 2004-05-25

    Logged In: YES
    user_id=192186

    Thanks, just commited into cvs.

     
  • Michal Čihař

    Michal Čihař - 2004-05-25
    • priority: 5 --> 1
    • summary: fix for zh-cn detecting --> (in 2.6.0) Fix for zh-cn language detection
    • status: open --> open-accepted
     
  • Michal Čihař

    Michal Čihař - 2004-05-25

    Logged In: YES
    user_id=192186

    I just forgot to mention, that I also changed cookie name.

     
  • Alexander M. Turek

    • status: open-accepted --> closed-accepted