Internationalization of admin bar

  • Author
  • #490647


    Just when I wanted to import new updates to translation of wpcom, I spotted new links in wpcom’s admin. Some of that other people spotted too, which was meanwhile removed, but there is still link “Edit post” that is showing on every blog, not just on your.

    But why I’m writing here is a huge change at how admin bar works now. Until now, language of admin bar was based on language of “Interface Language” and now it is based on “Blog Language”. What this means is that if you have Serbian as your interface language, when you visit blog in Japanese, admin bar will be in Japanese.

    Part of this started with introduction of “likening” when strings for it in admin bar were shown based on blog’s language. I didn’t write about it here because I thought someone will notice it and fix it. But now it got even worse.

    I strongly oppose to this and request that admin bar is shown based on language of interface. For what is language of interface used then if we have this? Just for It doesn’t make any sense to show different language for logged in users since they choose their language of interface. It make sense to show different language of admin bar to non-logged users as it was practice now (on front pages of locale sites, eg.

    Also, on a technical side, I don’t understand why you stopped using external JavaScript file for code of admin bar and instead you include it inline on every page load. Pages on wpcom are already slow for logged in users because of a lot of inline JS and CSS code, etc, and now you are increasing even more its size.

    What is even more ridiculous, you don’t have backward compatibility so old JavaScript file used here on forum for admin bar is giving 404 error so we don’t have it at all!

    I don’t like where wpcom is going with recent (and future, see below) admin bar changes and I think that will have negative effect on users.

    Finally, if you can add description here and/or context for new strings from admin bar, translators will be thankful. (strings like “Like (%s)”, “You like this (%s)”, “Bump to Tagazine only” etc)



    The admin bar used inline JS and CSS prior to the latest updates, it now uses separate files that can be cached, not the other way around.

    I’ll take a closer look at the translation issues you’re experiencing, the admin bar should make use of the interface language, not the blog language.



    You are right that it now uses separate files for JS and CSS at that is great. I didn’t noticed that immediately.

    But what I told also is that HTML code of admin bar was placed in an external JavaScript file which was generated by PHP script. Now it is at a bottom of a HTML source of a page, starting with <div id="wpcombar" class="snap_nopreview no-grav"> so it is loaded on every page.



    Having it in a separate file was actually worse for a few reasons; it’s another HTTP request, it was never cached since it always changed depending on the page, and it was using JS replacement functions which tax your browser more. These points all contributed to slowing down load times.



    I thought that JS file was cached, sorry. But new file admin-bar-css.php file is also not cached (I checked this) and is different for every theme, plus not all CSS related to admin bar is in it (there are still some inline). You could try to minify a little admin bar’s HTML since it has a lot of line breaks, some bits could be saved.

    Back on the subject. Now admin bar is again based on user’s language but there is still issue with my language, Serbian. Since there are two scripts in it, Nikolay made a plugin which enables users to choose usage of Latin script for WP’s strings (“Blog language”).

    So, if user’s language is Serbian, admin bar is in Serbian with Cyrillic script (this is how it should be), except when user comes to blog where owner chose to have Latin script where transliteration is applied to admin bar also.

    There are three more issues unrelated on i18n:

    • if setting on blog is that avatars are not shown, gravatar is not displayed in admin bar too
    • if user doesn’t have a gravatar, gravatar in admin bar is shown based on settings of blog (mystery man, identicon, monsterid, blank)
    • here at forums dropdown menus don’t work (plus you load two jQuery files)

The topic ‘Internationalization of admin bar’ is closed to new replies.