Victoire / localeswitcher-widget
此包已被弃用且不再维护。未建议替换包。
Victoire LocaleSwitcher 小部件
2.0.2
2017-03-31 13:00 UTC
Requires
- php: >=5.5.9
- symfony/framework-bundle: ~2.8|~3.0
- victoire/victoire: ~2 | ~3.0
README
Victoire LocaleSwitcher Bundle
此包的用途是什么
此包提供对 LocaleSwitcher Widget 的访问,该小部件可以在您的网站上启用语言切换功能。
设置Victoire
如果您尚未设置,可以按照以下步骤设置Victoire 这里
安装包
php composer.phar require victoire/localeswitcher-bundle
不要忘记在AppKernel中添加包!
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
...
new Victoire\Widget\LocaleSwitcherBundle\VictoireWidgetLocaleSwitcherBundle(),
);
return $bundles;
}
}
在语言切换器中添加一些额外的本地化链接
有时,例如对于一家大型公司,其子公司不由该网站管理,我们希望在语言切换器中添加额外的本地化链接。
只需添加一些配置即可完成操作
#config.yml
victoire_widget_locale_switcher:
extraLocalizedLinks:
jp: http://google.jp/
us: https://google.us/
ca: https://google.ca/
pl: http://google.pl/
...
您可以在 Resources/public/images/flags
中查看管理的国家完整列表。