翻译角UI分页 [英] Translate Angular-UI pagination

查看:120
本文介绍了翻译角UI分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能引导UI分页指令翻译文本?

How can I translate text in Bootstrap UI pagination directive?

我overrided常数这样的法文翻译:

I've overrided the constants like this for french translation:

angular.module('myapp', ['ui.bootstrap'])
    .constant('paginationConfig', {
        itemsPerPage: 10,
        boundaryLinks: false,
        directionLinks: true,
        firstText: 'Premier',
        previousText: 'Précédent',
        nextText: 'Suivant',
        lastText: 'Dernier',
        rotate: true
    })

但压倒一切的常数似乎是一个坏主意...

But overriding constants seems to be a bad idea...

什么是正确的方式(如果有的话)这样做呢?

What is the correct way (if any) to do this?

推荐答案

而不是overiding整个常量对象可以在中修改它的性能运行

Rather than overiding the whole constant object you can modify properties of it within the run method

var app=angular.module('myapp', ['ui.bootstrap']);

app.run(function(paginationConfig){
   paginationConfig.firstText='MY FIRST';
   paginationConfig.previousText='YOUR TEXT';

})

<大骨节病> 演示

这篇关于翻译角UI分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆