While reviewing the module for bugs I found a LOT of translatable string bugs that need to be fixed. I also fixed code style issues and enhanced the GUI a little bit with token browser.

Comments

hass created an issue. See original summary.

hass’s picture

Title: Code style / string review » Code style / translatable string review
hass’s picture

Status: Active » Needs review
StatusFileSize
new19.91 KB

I guess all these issues also exists in D8.

hass’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev
StatusFileSize
new22 KB

Why has popup_link no token support in D8? The token browser has therefore not added to D8.

svenryen’s picture

Thanks. :) Is there any reason why you sometimes use single quote and sometimes double quote?

hass’s picture

StatusFileSize
new19.8 KB

Reroled D7 because of some changes and some backports from D8 after code review.

hass’s picture

Is there any reason why you sometimes use single quote and sometimes double quote?

We have rules in Drupal for translatable strings.

  1. Typically we try to use single quotes only.
  2. If a single quote is inside a translatable string we do not escape it with \. In this case we switch to sourounding double quotes on the string and use the single quote inside the string. That means no escape sequences for translators.
  3. And in the wost case situation of one string here, we stay with sourounding doubles quotes and escapted double quotes inside the string.

This are for many years the translatable string rules of Drupal and Localization server that has issues if you don't follow the rules... some rules make translators life easier as escape sequences are not so funny to translate and could get removed by them.

We never use curly (?) quotes in english...

hass’s picture

Can you commit this before next release, please?

svenryen’s picture

The code needs review, but I hope to get around to it this weekend. If you get somebody to do the RTBC I can just commit it.

hass’s picture

+++ b/eu_cookie_compliance.module
@@ -34,7 +34,7 @@
       $output .= '<p>' . t('The module displays a banner at the bottom or the top of website to make users aware of the fact that cookies are being set. The user may then give
         his/her consent or move to a page that provides more details. Consent is given
         by user pressing the agree buttons or by continuing browsing the website. Once
-        consent is given another banner appears with a “Thank you” message.') . '</p>';
+        consent is given another banner appears with a "Thank you" message.') . '</p>';

This multiline stuff is forbidden. All need to be put into ONE line without line breaks.

  • svenryen committed feeca33 on 8.x-1.x authored by hass
    Issue #2974240 by hass: Code style / translatable string review
    

  • svenryen committed ab78b6b on 7.x-1.x authored by hass
    Issue #2974240 by hass: Code style / translatable string review
    
svenryen’s picture

Status: Needs review » Fixed

Fixed. Thanks!

  • svenryen committed 884a355 on 7.x-2.x
    Merge branch '7.x-1.x' into 7.x-2.x
    
    * 7.x-1.x:
    Issue #2975382 by...
  • svenryen committed ab78b6b on 7.x-2.x authored by hass
    Issue #2974240 by hass: Code style / translatable string review
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.