简体   繁体   English

poEdit找不到我的占位符的翻译

[英]poEdit do not find my placeholders' translations

I'm quite new to poEdit, and I'm successfully translating 95% of my keys in my javascript templates and files. 我对poEdit还是很陌生,并且已经成功地在我的javascript模板和文件中翻译了95%的键。

I use this syntax __("key") , mainly <%= __("key") %> . 我使用这种语法__("key") ,主要是<%= __("key") %>

But (there always is a but), for some reason, this key email in placeholder 但是 (总是有一个but),由于某种原因,此关键email位于占位符中

enter code here <input type='text' name=' username' placeholder='<%= _ ("email") %>'> enter code here <input type ='文本'name =' 用户名'placeholder ='<%= _ (“电子邮件”)%>'>

is not parsed with poEdit. 没有用poEdit解析。

I'm using Python parser; 我正在使用Python解析器; with __ keyword. __关键字。 What did I miss ? 我错过了什么 ?

Thanks for you help 谢谢你的帮助

You say yourself that you use the __ (double underscore) keyword. 您说自己使用了__ (双下划线)关键字。 _ (single underscore) used in your other example is a different identifier, so of course it isn't found. 在另一个示例中使用的_ (单个下划线)是一个不同的标识符,因此当然找不到它。

As a side note, lying to the tools (be it Poedit or xgettext ) about the language (as you do, this is no Python) is bound to cause… interesting… things sooner or later. 附带说明一下,对语言(如您所做的,这不是Python)的工具(无论是Poedit还是xgettext )的说谎必定会引起……有趣的……早晚发生的事情。

Unlike @Vaclav said below, I finally did not rely on xgettext (and its language validation) and made my own parser (just a parser) in PHP. 与下面的@Vaclav不同,我最终不依赖xgettext(及其语言验证),而是在PHP中创建了自己的解析器(只是一个解析器)。

Here is the open source project, if it could help some of you https://github.com/Wisembly/jsgettext 这是一个开源项目,如果它可以帮助某些人https://github.com/Wisembly/jsgettext

Best 最好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM