在basic example for bottle i18n中,msgID用于获取相应语言的字符串。
return bottle.template("<b>{{_('hello')}} I18N<b/>?")
corresponding .po中的,定义了msgid:
msgid "hello"
msgstr "Hello"
在other projects中,.po不仅包含msgid和msgstr,还包含之前的密钥,使用井号进行定义。这对于较长的短语尤其有用,以避免源代码混乱:
#: wordpress_file_monitor.php:138 wordpress_file_monitor.php:147
msgid "Remove Alert"
msgstr "Benachrichtigung entfernen"
如何使用bottle-i18n访问此#键?