Support » Plugin: WordPress Popular Posts » Translation of “x views”

  • Resolved Matta Cib


    first of all: Thanks a lot for the nice plugin! Seems to work fine and will be an enrichment for my site.

    The problem: In the widget I’d like to output the expression “x views” (english) in “x Aufrufe” (german).

    The problem was already discussed on the page – I have read that, but can’t find a solution.

    What I’ve tried to resolve the problem up to now:
    I checked if the german language-files
    – wordpress-popular-posts-de_DE.po
    – wordpress-popular-posts-de_DE-df846687c944e32b832cf21c86e75d8a.json.
    are installed in the folder /wp-content/languages/plugins/. Yes, they are.
    I checked with PoEdit, if the po-file contains the correct translation (views -> Ansichten). Yes, it does.
    But even though in the po-file the translation is done correctly, in the widget still appears “views” instead of “Ansichten”.
    So what could I do to make appear “Ansichten” in the widget as well?

    In the above mentioned user-question the user finally mentioned that he had resolved the problem by configuring the output.php. If this is the only solution: I’ve no idea what to change in this file. In which line which expression has to be replaced by what?

    Thanks a lot for your help and kind regards.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Héctor Cabrera


    Hi @matta-cib,

    The reason why the “x views” phrase is shown in English on your website is because no one has translated it into German, even after all of these years :/

    If you can and have the time, please suggest a translation so the WordPress team can add it to the official German language pack.

    Thread Starter Matta Cib


    Hello Héctor,
    thanks for your advice. I thought the translation would refer to WP Popular Posts’ po-files and not to the official german language pack of WP, but I followed your advice and made a suggestion for a translation there.
    But I’m not sure if this is the reason for the missing translation: The term “Views” (with uppercase letter V) ist already translated there on that page (third green row). May be WP treats “Views” in another way than “views”? We’ll see.
    Kind regards

    Plugin Author Héctor Cabrera


    May be WP treats “Views” in another way than “views”?

    You’re right. The word “views” has been translated into German and it should be displayed in German on the other places where the plugin uses this specific word on its own.

    However for the word “views” to be used next to a number, eg. “23 views”, it needs to be translated separately. You see, each language handles numbers differently. Not all of them follow the same grammatical rules.

    For example, in English we have “1 view” (singular) and “2 views” (plural). The only difference here is that for plurals we just add an “s” letter to the word “view”. Same rule applies to many other languages, like Spanish (“1 vista”, “2 vistas”). In German -and after seeing your translation suggestion- I guess you only need to add an “e” to “Aufruf” to convert that word into its plural form (?).

    Other languages, like Russian for example, don’t treat singulars and plurals the same way. They have (very) different grammatical rules which is the reason why we have a separate translatable text for numbers so that it can be translated to any language according to its own rules.

    Anyways, sorry for the long comment and thank you very much for helping out. Hopefully someone from the WordPress Translation team will approve your suggestion soon.

    Alternatively if you don’t want to wait for the translation to be approved (since this usually takes some time, the WordPress team doesn’t have enough translators available), try this:

    1. Download a copy of the WordPress Popular Posts plugin to your desktop (click on the Download button on the Details page to get it).
    2. Open the zip file you just downloaded and extract it to your desktop.
    3. Copy the wordpress-popular-posts-de_DE.po file from /wp-content/languages/plugins/, then open the wordpress-popular-posts folder on your desktop and go to the i18n folder, and paste the wordpress-popular-posts-de_DE.po there.
    4. Open the wordpress-popular-posts/i18n/wordpress-popular-posts-de_DE.po file with Poedit.
    5. Click on Catalog > Update from POT file… and select the wordpress-popular-posts.pot file.
    6. Find (ctrl + F) the %s view text and translate it using the Translation box you’ll see below. Use the tabs to translate both the singular version and the plural version.
    7. When you’re done, save changes and close Poedit.
    8. Copy wordpress-popular-posts-de_DE.po and from /wordpress-popular-posts/i18n/ and paste them into /wp-content/languages/plugins/ to replace the existing German translation files.

    If everything went OK you should see now that “x view” and “x views” are being translated to “x Aufruf” and “x Aufrufe” respectively, @matta-cib.

    Thread Starter Matta Cib


    Hello Héctor,
    thank you very, very much for your detailed response and instruction to resolve the translation-problem!! Now it works fine with “Aufrufe” 😉
    (I still have another problem, but I suppose that it will be better to create a new thread.)
    Kind regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translation of “x views”’ is closed to new replies.