Title: Polylang &#8211; Country Detection
Author: Markus Wiesenhofer
Published: <strong>2020 年 7 月 20 日</strong>
Last modified: 2022 年 9 月 30 日

---

搜索插件

![](https://ps.w.org/country-detection-polylang/assets/banner-772x250.jpg?rev=2343650)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/country-detection-polylang/assets/icon-256x256.jpg?rev=2344040)

# Polylang – Country Detection

 作者：[Markus Wiesenhofer](https://profiles.wordpress.org/markusfroehlich/)

[下载](https://downloads.wordpress.org/plugin/country-detection-polylang.zip)

 * [详情](https://cn.wordpress.org/plugins/country-detection-polylang/#description)
 * [评价](https://cn.wordpress.org/plugins/country-detection-polylang/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/country-detection-polylang/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/country-detection-polylang/#developers)

 [支持](https://wordpress.org/support/plugin/country-detection-polylang/)

## 描述

Polylang is a fantastic plugin to make WordPress multilingual. The Polylang extension
enables you to detect the preferred language according on the country.

If your website contains 2 different locales with the same language (e.g. de_DE 
for German/German and de_AT for German/Austria) then Polylang automatically sets
the language according to the browser settings.

Austrian website visitors who have set their operating system / browser to Germany(
e.g. the Devices was buyed in Germany) will always be redirected to de_DE.

This Plugin detects the preferred language according on the visitors country and
will set the language correct to de_AT.

Please notice that the IP API is only for non-commercial use allowed.

#### Required Plugin

 * [Polylang Pro](https://polylang.pro) by WP SYNTEX – Polylang allows you to create
   a bilingual or multilingual WordPress site.

## 安装

 1. Install the required Polylang Plugin available at https://polylang.pro
 2. Upload ‘pll-country-detection’ to the ‘/wp-content/plugins/’ directory, or install
    the plugin through the WordPress plugins screen directly.
 3. Activate the plugin through the ‘Plugins’ screen in WordPress.
 4. Enable the “Detect browser language” option in “Languages > Settings”

## 常见问题

### How does the country detection works?

The plugin detects the country with the IP Geolocation API (https://ip-api.com/).

If no available language by country is found, the language of the browser is preferred.(
https://polylang.pro/doc/detect-the-browser-preferred-language/)

### I found a bug, what shall I do?

If you have found a bug in my plugin, please send me an email with a short description.

I will fix the bug as soon as possible.

### You like my plugin and you’d like to support me?

Thank you very much!
 In case you want to show how much you appreciate my work, 
I’d be very grateful if you could give me positive rating with WordPress-Page and/
or donate a small amount to me.

## 评价

![](https://secure.gravatar.com/avatar/4411abd504c370e69119cc9d8d65b3ca4865f11356bde1fc63028cbb3f46fc8a?
s=60&d=retro&r=g)

### 󠀁[works great](https://wordpress.org/support/topic/works-great-6959/)󠁿

 [lschweig](https://profiles.wordpress.org/lschweig/) 2020 年 7 月 21 日

already in use – works great

![](https://secure.gravatar.com/avatar/f77fbde65964992ffacbbbae8260097491883794a07d77c75157783d9af8d0d2?
s=60&d=retro&r=g)

### 󠀁[Very good](https://wordpress.org/support/topic/very-good-4962/)󠁿

 [fank](https://profiles.wordpress.org/fank/) 2020 年 7 月 21 日

The country detection works really well!

 [ 阅读所有2条评价 ](https://wordpress.org/support/plugin/country-detection-polylang/reviews/)

## 贡献者及开发者

「Polylang – Country Detection」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Markus Wiesenhofer ](https://profiles.wordpress.org/markusfroehlich/)

「Polylang – Country Detection」插件已被翻译至 3 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/country-detection-polylang/contributors)
为本插件所做的贡献。

[帮助将「Polylang – Country Detection」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/country-detection-polylang)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/country-detection-polylang/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/country-detection-polylang/)，或
通过[RSS](https://plugins.trac.wordpress.org/log/country-detection-polylang/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/country-detection-polylang/)。

## 更新日志

#### 1.3.1

 * Fix – Check if the class Polylang_Country_Detection already exists

#### 1.3.0

 * Feature – Anonymize the IP addresses from the client
 * Dev – Changed the geolocation API from ip-api.com to iplocate.io
 * Dev – Check compatibility with latest Polylang and WordPress Version

#### 1.2.1

 * Fix – Filter all non active languages

#### 1.2.0

 * Translation functionality added

#### 1.1.0

 * Fix – Lanaguage variable return issue

#### 1.0.0

 * Initial Release
 * Check compatibility with latest Polylang and WordPress Version

## 额外信息

 *  版本 **1.3.1**
 *  最后更新：**4 年前**
 *  活跃安装数量 **1,000+**
 *  WordPress 版本 ** 4.9 或更高版本 **
 *  已测试的最高版本为 **6.0.11**
 *  PHP 版本 ** 5.6 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/country-detection-polylang/) 、 
   [French (Belgium)](https://fr-be.wordpress.org/plugins/country-detection-polylang/)、
   [French (France)](https://fr.wordpress.org/plugins/country-detection-polylang/)
   和 [Persian](https://fa.wordpress.org/plugins/country-detection-polylang/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/country-detection-polylang)
 * 标签
 * [browser](https://cn.wordpress.org/plugins/tags/browser/)[country](https://cn.wordpress.org/plugins/tags/country/)
   [detection](https://cn.wordpress.org/plugins/tags/detection/)[multilingual](https://cn.wordpress.org/plugins/tags/multilingual/)
   [polylang](https://cn.wordpress.org/plugins/tags/polylang/)
 *  [高级视图](https://cn.wordpress.org/plugins/country-detection-polylang/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/country-detection-polylang/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/country-detection-polylang/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/country-detection-polylang/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/country-detection-polylang/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/country-detection-polylang/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/country-detection-polylang/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/country-detection-polylang/reviews/)

## 贡献者

 *   [ Markus Wiesenhofer ](https://profiles.wordpress.org/markusfroehlich/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/country-detection-polylang/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/donate?business=DUKJP25LKTX62&currency_code=EUR)