Title: Possible code error
Last modified: May 5, 2017

---

# Possible code error

 *  ResolvedModerator [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/)
 * (@tobifjellner)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/)
 * Hi, while I was looking at the Swedish translation of this plugin, I noted several
   strings that rather look like programming parameters, which one really shouldn’t
   translate.
 * Here’s one example from your code:
    `$ban_type = $this->_input->__('ban_type','
   ban_forever');` I have a feeling that you here actually didn’t intend to use 
   the translation function `__()` (and even with incorrect text-domain…)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [PeepSo, Inc.](https://wordpress.org/support/users/peepso/)
 * (@peepso)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9105264)
 * It’s the fault of POT that mistakes methods like PeepSoInput::__(string, string);
   as gettext
 * These have to be simply ignored
 *  Moderator [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/)
 * (@tobifjellner)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9106499)
 * If that’s the case, then perhaps the structure `CommandOrMethod::__(string, string)`
   isn’t such a good choice.
    After all `_()` is a standard formula used by gettext,
   and `__()`, since long, is the wrapper of the same function in a platform (WordPress)
   that happens to power a really big part of the web…
 *  Moderator [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/)
 * (@tobifjellner)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9106503)
 * Alternativtely, you could suggest updates to the string scraper code so that 
   it wouldn’t pick up these strings…
    WordPress.org doesn’t even look at any pot-
   file you may have supplied. The plugin directory automatically scrapes every 
   update for strings using a matching algorithm for wrapped gettext functions.
 *  Plugin Contributor [Matt Jaworski](https://wordpress.org/support/users/jaworskimatt/)
 * (@jaworskimatt)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9107277)
 * Unfortunately, we didn’t realize WP/gettext is too “stupid” to handle this until
   it was too late. And changing the method name again is not that simple because
   all child plugins are using them and we have 3rd party developers using them 
   too.
 * Are you looking via Crowdin or the WP.org translation engine? Because we generally
   use Crowdin and the “weird” string have been blacklisted there.
 * [https://crowdin.com/project/peepso](https://crowdin.com/project/peepso)
    -  This reply was modified 9 years ago by [Matt Jaworski](https://wordpress.org/support/users/jaworskimatt/).
    -  This reply was modified 9 years ago by [Matt Jaworski](https://wordpress.org/support/users/jaworskimatt/).
 *  Plugin Contributor [Matt Jaworski](https://wordpress.org/support/users/jaworskimatt/)
 * (@jaworskimatt)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9107310)
 * I’ve put an improvement ticket for this. Right now it’s scheduled for 1.8.1 milestone,
   we will try and rename the method to something else without breaking compatibility
   with out own plugin “universe”.
 *  Moderator [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/)
 * (@tobifjellner)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9107335)
 * I’m working with the translation environment at translate.wordpress.org. If it
   would be possible to rename your method, that’s possibly the best approach. An
   alternative solution might still be to add an exclusion for the code scanner 
   that import strings to polyglot for translation.
    (By the way, I’m afraid that
   even poedit has a is similarly stupid scanner, but nobody would get the idea 
   to scan specifically your WordPress plugin with that one, though, at least if
   you provide an always updated .pot with each release…)
 * A stop-gap might be to add comments to translators on the immediately preceding
   line. Here’s an example from the developer handbook:
    printf(
 *     ```
           /* translators: 1: Name of a city 2: ZIP code */
           __( 'Your city is %1$s, and your zip code is %2$s.', 'my-plugin' ),
           $city,
           $zipcode
       );
       ```
   
 * So you might add a line like:
    `/* translators: No need to translate this one.
   Just copy the English version */`
 * EditAdd:
    The reason I suggest to do it this way is that any translation package
   would start getting distribution only after 95% readiness is reached.
    -  This reply was modified 9 years ago by [tobifjellner (Tor-Bjorn “Tobi” Fjellner)](https://wordpress.org/support/users/tobifjellner/).
      Reason: EditAdd
 *  Plugin Contributor [Matt Jaworski](https://wordpress.org/support/users/jaworskimatt/)
 * (@jaworskimatt)
 * [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9107350)
 * Yup, but we are talking about 500+ occurences here, so adding a comment each 
   time is not really something we want to do.
 * We will rename the method – need to run a project wide “find and replace” on 
   the codebase of all 20ish plugins, and then manually verify everything, plus 
   fire the entire automated testing run just to make sure nothing broke.
 * 1.8.0 is already in code freeze, so it will be “fixed” in 1.8.1. The timeframe
   for that release is not set yet, though.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Possible code error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/peepso-core_e0dcd7.svg)
 * [Community by PeepSo - Download from PeepSo.com](https://wordpress.org/plugins/peepso-core/)
 * [Support Threads](https://wordpress.org/support/plugin/peepso-core/)
 * [Active Topics](https://wordpress.org/support/plugin/peepso-core/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/peepso-core/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/peepso-core/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Matt Jaworski](https://wordpress.org/support/users/jaworskimatt/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/possible-code-error/#post-9107350)
 * Status: resolved