De_de语言环境无法正常工作

时间:2016-02-15 13:37:50

标签: php locale

有多种语言的网站(lv,ru,en,pl,de)。当我设置de_DE时,setlocale(LC_ALL,0)返回“C”,在其他语言上一切正常。

我的设置区域设置的代码:

if (window.location.hash) {

    // Function to 'slugify' the fragment
    // @see https://gist.github.com/mathewbyrne/1280286#gistcomment-1606270

    var slugify = function(input) {
        return input.toString().toLowerCase().trim()
            .replace(/\s+/g, '-')           // Replace spaces with -
            .replace(/&/g, '-and-')         // Replace & with 'and'
            .replace(/[^\w\-]+/g, '')       // Remove all non-word chars
            .replace(/\-\-+/g, '-');        // Replace multiple - with single -
    }

    // Now get the hash and 'slugify' it

    var hash = slugify(window.location.hash.split('#')[1]);

    // Go to the new hash by setting it

    window.location.hash = '#' + hash;

}

我还检查了debian的地址,他们也在那里:

// Set locale
if (!setlocale(LC_ALL, $locale . '.utf8', $locale . '.utf-8', $locale . '.UTF8', $locale . '.UTF-8', $locale . "@euro")) {
    // Set current locale
    setlocale(LC_ALL, '');
}

1 个答案:

答案 0 :(得分:0)

变量de-De中的值是错误的,而不是de_DE