PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 15, 2022

[FIXED] Yii: GetText _() vs Yii::t()

 March 15, 2022     gettext, php, php-gettext, yii     No comments   

Issue

When translating strings in Yii with GetText, do we have to use Yii::t($category,'message') or gettext's _('message') syntax?

And then how do we pull the strings into a PO file?


Solution

You can put strings via POEdit app: http://poedit.net/ It allow you to scan your project files and automatically add all required strings into .po file.

If it comes to difference between Yii::t($category,'message') and _('message') - you should use Yii::t($category,'message'). GetText's _('message') works with a quite different po/mo catalog structure.

I personally use POEdit as string scanner and it works like a charm.



Answered By - Tomasz Szuba
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing