Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 898959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:08:10+00:00 2026-05-15T15:08:10+00:00

I am currently translating my PHP application using gettext with POEdit. Since I respect

  • 0

I am currently translating my PHP application using gettext with POEdit. Since I respect the print margin in my source code, I was used to writing strings like that:

print $this->translate("A long string of text
    that needs to follow the print margin and since
    php outputs whitespaces for every break line I do
    my sites renders correctly.");

However, in POEdit, as expected, the linebreaks are not escaped to whitespaces.

A long string of text\n
    that needs to follow the print margin and since\n
    php outputs whitespaces for every break line I do\n
    my websites render correctly.\n

I know one approach would be to close the strings when changing lines in the source code like that:

print $this->translate("A long string of text " . 
    "that needs to follow the print margin and since " .
    "php outputs whitespaces for every break line I do " .
    "my sites renders correctly. ");

But it is not an approach that is extensible for me when texts need to change and print margin
still respected, unless netbeans (the IDE I use) can do that for me automatically just like eclipse
in java.

So in conclusion, is there a way to tell the POEdit parser to escape linebreaks as whitespaces in the preferences?

I know that the strings are still translatable even though linebreaks are not escaped, I’m asking this so my traductor (sometimes even the customer/user) will avoid confusion into thinking he needs to duplicate the linebreaks while he translates in POEdit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:08:11+00:00Added an answer on May 15, 2026 at 3:08 pm

    You have to make sure that your using the right line breaks in your script and your app

     LF:    Line Feed, U+000A
     FF:    Form Feed, U+000C
     CR:    Carriage Return, U+000D
     CR+LF: CR (U+000D) followed by LF (U+000A)
     NEL:   Next Line, U+0085
     LS:    Line Separator, U+2028
     PS:    Paragraph Separator, U+2029
    

    Within Windows systems (ms-dos) there line feed is CR+LF, And within “Unix-like” systems its LF adn 8Bit commodore’s its a CR

    You have to make sure that the source location contains the same type of feeds to your edit location.

    Your server handles its line feeds different to the host that the editor is running on, just double check this and develope some means of auto replacing the Unicode chars depending on your OS


    As you say that your “translating my PHP application using gettext with POEdit”, i would create a script to go threw all your files via shell/doss/php and auto convert the character codes to the type of system your running on.

    so if your working on Windows then you would search for all chars that are U+000A and replace with U+000DU+000A

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP application using Gettext as the i18n engine. The translation works
I'm currently translating an application from actionscript-3 to Java code and got stuck with
I'm currently translating a application and i've stumbled upon a problem. I'm using this
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
To clarify: I'm not using the gettext php module /extension, reason being because I
I am currently developing an ecommerce software using PHP/MySQL for a big company. There
Currently using Gettext on a project and the .po files are nicely kept under
I'm currently building a multilingual website using PHP and MySQL and am wondering what
I am using PHP , Zend Framework and Zend_Translate (gettext adapter). To edit translations
I have cake php app and I am using translating function <?php __('msg'); ?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.