1

Which of the below is recommended when creating msgid a PO file?

msgid "Available Balance:"

or

msgid "Available Balance"

2
  • 1
    Does your code use __( 'Available Balance:', 'my-plugin' ) or __( 'Available Balance', 'my-plugin' )? They're two different strings as far as the code is concerned. If you've got both, you should translate both.
    – Pat J
    May 31, 2022 at 15:29
  • @PatJ Yeah, I was hoping to do only __( 'Available Balance', 'my-plugin' ) so I can use this for other purposes too,
    – ratib90486
    May 31, 2022 at 23:51

1 Answer 1

1

The use of each depends on your choice. If, for example, the text is in front of a field, I think it is better to use the symbol: In general, you should see if it really needs it or not. You do not have to use it or not. In the text you sent, the first option is more appropriate because the intention is to display a value in front of or below this text

2
  • I was thinking perhaps it's more convenient to use Available Balance since it can be used for other purposes. So that I don't have to have two almost identical keywords - one with : and one without. However, with that regard, I need to add a : in my PHP code.
    – ratib90486
    May 31, 2022 at 14:22
  • 2
    @ratib90486 Yes, as our friend (Pat J) answered your question in the comment, it is better to make a language file in accordance with the php code. Of course, first create the php file and then easily add the translation file using poedit software. It is always better to use: to display a value in front of the text or below the text
    – masoud nkh
    May 31, 2022 at 17:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.