[wordpress插件] Add Locale Class添加语言环境类

wordpress 插件 文章 2020-01-30 14:40 613 0 全屏看文

AI助手支持GPT4.0

评分

0

0

描述

On multi language sites there may be occasions when you want to render CSS according to the current language in use.

在多语言站点上,有时可能需要根据当前使用的语言来呈现CSS。

The Add Local Class plugin solves this problem by adding the current language code as a class in the body tag on both front end and admin pages.

Add Local Class插件通过在前端和管理页面的body标签中将当前语言代码添加为类来解决此问题。

For example, if you set the language of the site to French, then the language code used is fr_FR.

例如,如果您将网站的语言设置为法语,则使用的语言代码为fr_FR。

Add Local Class will retrieve the language code format it as ‘locale-fr-fr’ and add it to the body tags on the front end of the site.

“添加本地类”将检索语言代码格式为“ locale-fr-fr”,并将其添加到网站前端的body标签中。

It will also retrieve the language code of the backend user and set it as a body tag class on the back end of the site.

它还将检索后端用户的语言代码,并将其设置为网站后端的body标签类。

Should the site’s language be changed to U.S. English, then the class would be changed to ‘locale-en-us’.

如果网站的语言更改为美国英语,则课程将更改为“ locale-en-us”。

In your CSS file you can have one rule for French and another for English:

在CSS文件中,您可以为法语设置一条规则,而对于英语可以设置另一条规则:

.

locale-fr-fr .button {

locale-fr-fr .button {

background-color: blue;

背景色:蓝色;

}

}

.

locale-en-us .button {

locale-en-us .button {

background-color: red;

背景色:红色;

}

}

With the Add Local Class plugin it possible to make use of language specific CSS on your site.

通过添加本地类插件,可以在您的网站上使用语言特定的CSS。

This plugin does not have a settings page.

此插件没有设置页面。

You simple install and activate it.

您只需安装并激活它即可。

The Add Local Class plugin is brought to you by Max Foundry.

Max Localry为您带来了Add Local Class插件。

We make a WordPress Gallery plugin, a plugin for WordPress画廊插件,这是

-library-plus-pro/" rel="nofollow">WordPress media library folders and MaxButtons.<

-library-plus-pro /“ rel =” nofollow“> WordPress媒体库文件夹和 MaxButtons 。<

/p>

/ p>

安装步骤

Upload and unzip the plugin in your Plugins folder.

将插件上传并解压缩到“插件”文件夹中。

Go to your Plugins page and activate Add Local Class.

转到“插件”页面,然后激活“添加本地类”。

下载地址

https://downloads.wordpress.org/plugin/add-locale-class.1.0.1.zip

https://downloads.wordpress.org/plugin/add-locale-class.1.0.1.zip

-EOF-

AI助手支持GPT4.0