承接 wirelab/language_switcher-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wirelab/language_switcher-plugin

最新稳定版本:1.3

Composer 安装命令:

composer require wirelab/language_switcher-plugin

包简介

A plugin providing users with numerous ways of switching language.

README 文档

README

⚠️ This repository has been deprecated ⚠️

A PyroCMS 3 plugin providing users with numerous ways of switching language. The default types use bootstrap 3.

Installation

composer require wirelab/language_switcher-plugin

Usage

Call {{ languageSwitcher($type, $options) }} in the desired twig file.
For example {{ languageSwitcher('dropdown', {'toggle_title':'Choose language'}) }}

String $type

The default types are dropdown,modal, and li. When using the modal type make sure to call it after loading jQuery.

Default types

Li

68747470733a2f2f776972656c61622e6769746875622e696f2f696d616765732f6c616e67756167655f73776974636865722d706c7567696e2f6c692e706e67

Dropdown

68747470733a2f2f776972656c61622e6769746875622e696f2f696d616765732f6c616e67756167655f73776974636865722d706c7567696e2f64726f70646f776e2e706e67

Modal

The modal makes a cookie when dismissed.

68747470733a2f2f776972656c61622e6769746875622e696f2f696d616765732f6c616e67756167655f73776974636865722d706c7567696e2f6d6f64616c2e706e67

Making a new type

New types can be made by adding a view under <plugin path>/resources/views/. When making a new view it'll automatically add it as a type.

The following variables are passed to all views:
container.class
toggle.class
ul.class
li.class
a.class

toggle.title

locales array of all available locales formated like: [[url => locale],[url => locale]]

The current variables contain data about the locale that's currently in use
current.locale
current.country
current.language

The prefered variables contain data about the user.
prefered.locale
prefered.enabled Checks if the users language is available/enabled.
prefered.url Url to the current page in the users locale.
prefered.country
prefered.language

Array $options (optional)

The $options array accepts the following options:
container_class
toggle_class
toggle_title When no title is given the current locale will be used
ul_class
li_class
a_class
pecl Opt out of usign PECL ( Will remove some features)

统计信息

  • 总下载量: 4.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-10