首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏python3

    python gettext使用

    python中使用gettext进行语言国际化的方法 1.编辑源代码, 保存为gettextdemo.py import gettext catalogs = gettext.find("example ", localedir="locale", all=True) print 'catalogs:',catalogs t = gettext.translation('example', "locale 这里我使用xgettext,  MAC上使用homebrew 安装, 输入命令: >brew install xgettext 即可自动完成安装, 安装后的默认目录:/usr/local/Cellar/gettext /0.19.2/,  进入/usr/local/Cellar/gettext/0.19.2/bin 可以看到有很多可执行文件 , 我们这里需要用到xgettext 和 msgfmt 回到正题, 输入以下命令生成 而po,pot都是文本文件 这一步很关键,我在弄的时候没注意到这一步, 直接把.po文件复制成.mo文件, 导致出现以下类似的情况, 掉到坑里,半天爬不出来,汗~ File "C:\env\lib\gettext.py

    1.8K20发布于 2020-01-03
  • 来自专栏python前行者

    gettext安装及使用

    @[toc]gettext安装下载gettextforWindows访问官方下载页面:https://mlocati.github.io/articles/gettext-iconv-windows.html 或者直接下载:https://github.com/mlocati/gettext-iconv-windows/releases下载并解压下载最新版本的gettext0.21-xxx.zip,解压到某个目录 ,比如:C:\ProgramFiles\gettext添加到系统环境变量按Win+S搜索"环境变量"选择"编辑系统环境变量"点击"环境变量"在"系统变量"中找到Path,点击"编辑"点击"新建",添加gettext 的bin目录路径:收起代码语言:TXTAI代码解释C:\ProgramFiles\gettext\bin点击"确定"保存所有更改验证安装安装完成后,验证gettext是否正常工作:收起代码语言:TXTAI 实现多语言支持⁠gettext是一个用于国际化(i18n)和本地化(l10n)的工具,主要用于管理软件中的文本翻译。

    23310编辑于 2025-10-08
  • 来自专栏ionic3+

    TypeError: tsDiagnostic.file.getText is not a function

    android --prod 有人回复这样处理: https://stackoverflow.com/questions/49829158/typeerror-tsdiagnostic-file-gettext-is-not-a-function

    94530发布于 2018-08-20
  • 来自专栏python3

    gettext模块实现Python国际化

    1.gettext模块介绍 gettext模块为Python模块和应用程序提供国际化(i18n)和本地化(l10n)服务。 它提供两套API,一套高层的类似于GNU gettext的API和一套基于类的API。前者适用于单语言的场景,并且语言的选择通常依赖于用户的locale,会全局性地影响到你整个应用程序语言的转译。 (b)编辑my_app.py,先输入以下内容 # -*- coding: utf-8 -*- import gettext _ = gettext.gettext if __name__ == " 模块时,gettext模块有两种使用方式。 , # 本程序只使用了一个域 gettext.textdomain(APP_NAME) _ = gettext.gettext if __name__ == "__main__":     print

    2.8K10发布于 2020-01-07
  • 来自专栏前端资源

    gettext msgfmt安装及pomo文件编译转换

    这里需要 gettext 的 msgfmt 。 安装 gettext : 这里以 CentOS 为例,其他平台安装命令放在最后面。 : 操作系统 包管理器 安装命令 Windows scoop scoop install gettext macOS HomeBrew brew install gettext GNU/Linux LinuxBrew _OSZorin OSelementaryOSPCLinuxOS apt sudo apt-get install -y gettext CentOS yum sudo yum install -y gettext FedoraMageia dnf sudo dnf install -y gettext openSUSE zypper sudo zypper install -y gettext-tools gettext-runtime pacman -S    --noconfirm gettext Gentoo Linux Portage sudo emerge gettext 未经允许不得转载:w3h5 » gettext msgfmt

    3.5K20发布于 2020-10-16
  • 来自专栏Fdu弟中弟

    制作一个简易计算器

    arg2 = Double.parseDouble(label.getText()); } else if(e.getSource() = label.setText(label.getText()+"3"); arg2 = Double.parseDouble(label.getText()); } else if(e.getSource() == button4) { label.setText(label.getText arg2 = Double.parseDouble(label.getText()); } else if(e.getSource() = label.setText(label.getText()+"7"); arg2 = Double.parseDouble(label.getText());

    1K20发布于 2021-02-24
  • 来自专栏全栈程序员必看

    Mac安装brew,安装wget「建议收藏」

    If you need to have gettext first in your PATH run: echo 'export PATH="/usr/local/opt/gettext/bin:$ /local/opt/gettext/lib" export CPPFLAGS="-I/usr/local/opt/gettext/include" ==> Summary ? gettext library & some software gets confused if both are in the library path. If you need to have gettext first in your PATH run: echo 'export PATH="/usr/local/opt/gettext/bin:$ /local/opt/gettext/lib" export CPPFLAGS="-I/usr/local/opt/gettext/include" ==> openssl A CA file has

    1.3K10编辑于 2022-09-05
  • 来自专栏张泽旭的专栏

    java高扩展计算器

    ().equals("+")||jb.getText().equals("-")||jb.getText().equals("*")||jb.getText().equals("/")||jb.getText ().equals("1")||jb.getText().equals("2")||jb.getText().equals("3")||jb.getText().equals("4")||jb.getText ().equals("5") ||jb.getText().equals("6")||jb.getText().equals("7")||jb.getText().equals ("8")||jb.getText().equals("9") ||jb.getText().equals("0")||jb.getText().equals(" ")) { str1=str1+jb.getText(); str2=str2+jb.getText();

    2.2K20发布于 2018-12-10
  • 来自专栏花狗在Qt

    QT多个按钮信号绑定一个槽函数,执行不同业务逻辑。

    //例如这样: connect(btn1,SIGNAL(clicked()),this,SLOT(getText1())); connect(btn2,SIGNAL(clicked()) ,this,SLOT(getText2())); connect(btn3,SIGNAL(clicked()),this,SLOT(getText3())); connect(btn4, SIGNAL(clicked()),this,SLOT(getText4())); connect(btn5,SIGNAL(clicked()),this,SLOT(getText5())); //然后再去实现getText1,getText2,getText3,getText4,getText5 其实五个槽函数里面的业务逻辑,只是输出对于的人名,可以说是一个业务逻辑,现在却需要五个函数,函数的作用就是为了解重复代码 } connect(myMapper, SIGNAL(mapped(int)), this, SLOT(getText(int))); //然后我们编写getText(int)这个槽函数即可 void

    2.6K10编辑于 2022-01-11
  • 来自专栏微信公众号:Java团长

    Java实现超市管理系统(含数据库)

    (); String age=this.jTextField3.getText(); String QQ=this.jTextField4.getText(); String userName=this.jTextField5.getText(); String password1=this.jPasswordField1.getText(); (); String goodsTypeName=goodsTypeNameTxt.getText(); String goodsTypeDesc=goodsTypeDescTxt.getText (); String price=this.priceTxt.getText(); String goodsDesc=this.goodsDescTxt.getText( (); String price=this.priceTxt.getText(); String goodsDesc=this.goodsDecTxt.getText()

    4K31发布于 2021-01-20
  • 来自专栏全栈程序员必看

    赚一个亿真的不难,不信你看下面代码

    // TODO add your handling code here: if(Salary.getText ().isEmpty()||Aim.getText().isEmpty()||Saving.getText().isEmpty()) { JOptionPane.showMessageDialog rootPane,"战胜恐惧的最好办法就是面对恐惧,乖乖把信息填全"); return; } Double money=Double.parseDouble(Salary.getText ()); Double Target=Double.parseDouble(Aim.getText()); Double saving=Double.parseDouble( Saving.getText()); double a =saving; int numofyears=0; do { int

    31500编辑于 2022-07-01
  • 来自专栏tea9的博客

    android-alert写法备忘

    } else { String name = input_name_edittext.getText toString()); double single_price ; if (input_price_edittext.getText ")) { single_price = 0; } else if (input_price_edittext.getText .toString()); double single_price = Double.valueOf(input_price_edittext.getText ().toString()); double single_price = Double.valueOf(input_price_edittext.getText

    2K10编辑于 2022-07-16
  • 来自专栏散尽浮华

    php安装扩展模块后,重启不生效的原因及解决办法

    扩展 [root@zabbix ~]# cd /data/software/php-5.6.10/ext/gettext/ [root@zabbix gettext]# /data/php/bin/phpize [root@zabbix gettext]# . /configure --with-php-config=/data/php/bin/php-config [root@zabbix gettext]# make && make ....... [root@zabbix ~]# php -m|grep bcmath [root@zabbix ~]# php -m|grep gettext [root@zabbix ~]# 发现并没有生效! [root@zabbix ~]# php -m|grep bcmath bcmath [root@zabbix ~]# php -m|grep gettext gettext [root@zabbix

    2.9K30发布于 2018-10-15
  • 来自专栏闵开慧

    jquery中各个ajax实例操作

    c=3&t=5", async:false});//不要忘记{} $("#getText1").html(htmlOjbect.responseText); }); //ajaxSend this).html("正在请求……"+opt.url);//此处的url就是下面的load地址 }); $("#button2").click(function(){ $("#getText2 c=5&t=5",function(result){ $(".getText3").html(result); }); }); //get() method2 ">

    <button class="button3">get异步获取内容1</button>
    </ div>
    <button class="button4">get异步获取内容2</button>

    1.2K80发布于 2018-03-30
  • 来自专栏Kevinello的技术小站

    浅尝antlr4

    : JavaParser.PackageDeclarationContext): self.ast_info['packageName'] = ctx.qualifiedName().getText End line: {1} | Method name: {2}".format(ctx.start.line, ctx.methodBody().stop.line, ctx.getChild(1).getText exitMethodDeclaration(self, ctx: JavaParser.MethodDeclarationContext): c1 = ctx.getChild(0).getText ctx.getChild(3)) elif c3 == 'extends': c4 = ctx.getChild(3).getChild(0).getText (), 'fieldDefinition': ctx.getChild(1).getText() } self.ast_info['fields'

    2.3K21编辑于 2022-08-19
  • 来自专栏终身开发者

    源码分析——从AIDL的使用开始理解Binder进程间通信的流程

    首先我们创建一个项目,写一个 RemoteService.java,并定义个 AIDL接口 IRemoteService.aidl interface IRemoteService { String getText 0x03 IRemoteService 接口 系统自动生成的这个文件中有除了我们定义 getText()方法外还生成了两个内部类 Stub和 Proxy。 当客户端调用 iRemoteService.getText()时其实是进入到 Proxy类中 getText()方法。 _data和 _reply分别为 getText()需要传递的参数和返回值, getText()无需参数,只有 String类型返回值。 这时候会执行到 onTransact()方法中的 _result=this.getText()方法。而 Stub类是在 RemoteService中实现的,故就访问到远程服务中资源了。

    1.1K20发布于 2019-07-31
  • 来自专栏葬爱家族

    Android 千变万化 TextView:神奇的 SpannableString

    0, txBord.getText().length(), SPAN_EXCLUSIVE_EXCLUSIVE); txBord.setText(ss); ? SpannableString ss = new SpannableString(txUnderLine.getText()); ss.setSpan(new UnderlineSpan(), 0, txUnderLine.getText ), 0, txBullte.getText().length(), SPAN_EXCLUSIVE_EXCLUSIVE); txBullte.setText(ss); ? SpannableString ss = new SpannableString(txScaleX.getText()); ss.setSpan(new ScaleXSpan(2.5f), 0, txScaleX.getText 这样设置后,字符串 str 就和 drawable 对象对应上了,在显示时会显示 drawable,但是调用 editText.getText() 得到的还是字符串。

    5.1K20发布于 2020-03-20
  • 来自专栏韩曙亮的移动开发专栏

    【Groovy】Groovy 扩展方法 ( 扩展静态方法示例 | 扩展实例方法示例 | 扩展实例方法与扩展静态方法代码相同 )

    return createThread(null, false, closure); } 二、扩展实例方法示例 ---- 声明 InputStream 实例对象 , 该实例对象可以调用 getText 扩展方法 ; InputStream inputStream inputStream.getText() 使用 InputStream 类无法调用 getText() 方法 ; 这说明 为 InputStream 扩展的 getText 方法 , 是一个 实例方法 , 只有实例对象能调用该扩展方法 , 类无法调用该扩展方法 ; 查看为 InputStream 扩展的 getText() * @since 1.0 */ public static String getText(InputStream is) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); return getText(reader)

    1.5K30编辑于 2023-03-30
  • 来自专栏Java进阶架构师

    Java实现超市管理系统(含数据库)

    (); String age=this.jTextField3.getText(); String QQ=this.jTextField4.getText(); String userName=this.jTextField5.getText(); String password1=this.jPasswordField1.getText(); (); String goodsTypeName=goodsTypeNameTxt.getText(); String goodsTypeDesc=goodsTypeDescTxt.getText (); String price=this.priceTxt.getText(); String goodsDesc=this.goodsDescTxt.getText( (); String price=this.priceTxt.getText(); String goodsDesc=this.goodsDecTxt.getText()

    10K63发布于 2021-01-22
  • 来自专栏飞鸟的专栏

    设计模式-命令模式示例

    () { return textEditor.getText(); }}最后是客户端代码,它创建了一个文本编辑器和一个用户界面,并测试了撤销和重做操作。 ; ui.executeCommand(addCommand2); System.out.println(ui.getText()); // Hello World! // 撤销 ui.undo(); System.out.println(ui.getText()); // Hello // 撤销 ui.undo (); System.out.println(ui.getText()); // // 重做 ui.redo(); System.out.println (ui.getText()); // Hello // 重做 ui.redo(); System.out.println(ui.getText()); //

    32030编辑于 2023-05-04
领券