PHP language detection

前端 未结 9 2249
陌清茗
陌清茗 2020-12-14 16:32

I\'m trying to build multilangual site.

I use this piece of code to detect users language. If you havent chosen a language, it will include your language file based

9条回答
  •  太阳男子
    2020-12-14 17:13

    You can use: Locale::acceptFromHttp().

    Tries to find locale that can satisfy the language list that is requested by the HTTP "Accept-Language" header.

提交回复
热议问题