eyjae.blogg.se

Poedit add new string
Poedit add new string









poedit add new string
  1. Poedit add new string code#
  2. Poedit add new string download#

Return htmlspecialchars(_($msg_id), ENT_COMPAT | ENT_HTML401, 'UTF-8') Įdit: The answer to the updated question is "no, not with Poedit". * Fetches translation as HTML (single line) Return nl2br(htmlspecialchars(_($msg_id), ENT_COMPAT | ENT_HTML401, 'UTF-8'), false) * Fetches translation as HTML (block with line feeds) This is pretty lengthy so I suggest writing wrappers: /** Note the bubble icon on the left side of a string indicates there is a Comment, generally containing the. A POT file is essentially an empty PO file without the translations, with just the original strings. Launch Poedit and Create new translation. They will have all the translation strings left empty.

Poedit add new string download#

  • The translatable string contains plain text With Poedit you can download a POT file POT file POT files are the template files for PO files.
  • This also makes the string usable in non-HTML context (e.g., a plain text e-mail message). It's normally safer to only accept plain text and escape it properly when injecting it in HTML context, e.g.: You give them too much power to break the app badly.

    Poedit add new string code#

    IMHO, accepting HTML code from translators is kind of risky. The string will be printed with echo, so the string should be valid HTML. (No idea about what other graphical tools do.)

    poedit add new string

    Unluckily, the popular Poedit program does not make it easy: you can type actual new lines with the Enter key but they are silently discarded on save! You can insert new lines even with Poedit but you need to type a \n escape sequence manually: The PO catalogue format itself does not restrict translations to be one-liners but you need to use proper markup: #: example.php:2











    Poedit add new string