Closed (fixed)
Project:
Localization client
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2010 at 23:05 UTC
Updated:
25 Jan 2011 at 00:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
gábor hojtsyThis is surely not all strings available in Drupal, there are many others (long descriptions are totally missing for example). We used to have similar issues due to modules calling out the t() API before the initialization of the language system but worked around that by nulling out our cache in the initialization. Can someone else reproduce this on D7 (there seems to be quite some users using this module on D7)?
Comment #2
andypostConfirm this in FF (win) when clearing search string filter
Comment #3
droplet commentedfreezes while do search.
I find that only freezes if it call from any function.
attatched a test file
ONLY in FF 3
IE6+, FF4, Chrome ok
Comment #4
zirvap commentedI got the same problem, at least partly: I get a lot of extra strings, but the browser doesn't freeze. (See screendump)
Drupal 7.0-rc2
l10n client 7.x-1.0-beta2
No other contrib modules
Is there other info that would be useful?
Comment #5
gábor hojtsy@zirvap: is there a date field or country selector on that form? Localization client only requests the list of strings used by Drupal, it does not make up its own stuff. So there must be a country list, time zone selector or something on that page.
Comment #6
zirvap commentedThere are definitively strings there which don't appear in the user interface. I turned off the core admin toolbar and went to look at some pages with very few interface strings. Attached are screendumps + HTML from the pages /user and /admin/help/text. (I installed one more language, with very few translations, to make it easier to identify the extra strings.)
I noticed another bug which may be related: The pages "Translate strings" and "Translated strings" don't work:
- "Translate strings" (/locale) says "No strings found to translate". The l10n_client toolbar disappears.
- "Translated strings" (/locale/translated) have no strings on the page, but translated strings (and only translated strings) are shown in the l10n_client toolbar.
Screendumps attached. Let me know if I shall make a separate issue for that.
Comment #7
gábor hojtsyYes, this is indeed an abnormally lot of strings for the given page (looked at the user page txt). Can you please try and install Drupal 7 core and l10n_client ONLY to try and avoid any other modules interfering, and then try to reproduce, so we can conclude it is indeed a problem with the module itself. If that is not reproducible, let's see what other module or setting makes it broken.
Comment #8
gábor hojtsyComment #9
zirvap commentedYep, same problem.
1. Installed today's dev version of Drupal core
2. Installed l10n_client, 7.0-1.x-beta-2 (via the admin interface)
3. Went to module page, activated locale and l10n_client
4. Activated another lanuage (Norwegian bokmål), set it as default. Did not import any translations.
5. Went to account page, strings looked OK (just the expected amount of strings)
6. Went to front page, still looked OK
7. Clicked "Translate strings" in navigation menu. No strings listed on page. Translation toolbar disappeared.
8. Clikced "Translated strings", translation toolbar still gone (this is different from the first test site)
9. Went to some other pages, and now I have lots and lots of strings in the l10n toolbar again. (See attached HTML file)
It doesn't look like the exact same list as for the first test site, for instance there's no list of countries. For the first test site, I chose a country during installation. This time, I didn't.
Possibly relevant info from the status report:
Comment #10
gábor hojtsyWell, this is handled by the locale() function. Localization client sets the 'locale_cache_strings' variable temporarily to 0 in the requests it runs in, so that locale() will not use the short string cache. I think in your case, that variable switch is not working for some reason. As that cache grows (ie. you click around more screens in Drupal), your l10n_client will display more and more unrelated strings on pages. You should debug if that variable is really 0 in locale(). See http://api.drupal.org/api/drupal/modules--locale--locale.module/function... (the mechanism is the same in Drupal 6).
Comment #11
gábor hojtsyBTW I tried to reproduce this on my Drupal 7 test setup, but could not. So looking forward to what you find. The code in l10n_client which facilitates this is:
Well, looking at this, it seems like we are not clearing the locale() internal cache in a good way. Some hook_init() implementation is probably calling t() in your case before l10n_client_init() can run, and the cache is not cleared. We should clear it differently in Drupal 7. Can you try this patch?
Comment #12
zirvap commentedHm, the patch in #11 had an effect, but I'm not sure exactly what.
For most of the pages, it seems to work now -- I get the expected strings.
For admin pages with tabs, I seem to get strings for both tabs at once (so on both /admin/people and /admin/people/permissions I get strings for both "Add user" (only visible on /admin/people tab) and the permission names (only visible on /admin/people/permissions).
On some pages I notice strings in the l10n_client interface which don't belong. For instance on /admin/modules these strings are shown (in addition to the ones in use:
about-us/team aliased to internal path node/456
member/jane-smith aliased to internal path user/123
sub-term: Country rock
sub-term: Fusion
sub-term: Hard rock
sub-term: Swing
term: Jazz
There are also additional strings on the admin/help pages.
It doesn't work at all with the overlay -- when the overlay is active, I only see strings from the home page when I'm looking at admin strings.
/locale and /locale/translated still don't work.
If it will help, I can give you access to the test site (it's online).
Re. #10: How do I check the value of a variable?
Comment #13
gábor hojtsyOnce agan, I'd like to ask you to investigate the deep contents of the page before you make assumptions about random strings appearing :) /admin/people has a dropdown with permission names, so not surprising that permission names are displayed on the page. I think the "Add a user" text on the permissions page is an artifact of how the menu system works (it is a local task on that level - ie. admin/people/create, so its a sibling to admin/people/permissions). If you go in with a debugger, you can prove for sure.
Country tock, Jazz and others appear, because those are contained in taxonomy_help()'s help for admin/help#taxonomy. Now, in Drupal 7, indicators of help available are printed on the module page. The way Drupal does this is that it invokes the respective help hooks for these paths. So all module help will be invoked for translation on module pages by the nature of this feature.
For the overlay, I've added this note to the project page:
It would be absolutely confusing to refresh the l10n_client UI as you navigate through your admin UI mixing up strings from the page behind the overlay and in the overlay. So since the overlay effectively displays two pages at once, and you are already confused with too many strings to translate, imagine if we mix strings from those two pages :) Fun, isn't it? Instead just skip using the overlay while translating your administrative UI.
Looks like the patch solved your problems then and we only got things which are explained when you look at how Drupal actually builds the page (which I suggest you do when finding such strange occurrences). So patch ready to go?
Comment #14
zirvap commentedReady to go :-)
I looked closer at the unexpected strings on the help pages, and it looks as if a lot of the strings from /admin/index are loaded on the /admin/help/... pages. It's consistent, so I'll assume these strings are loaded by Drupal in the background, like you described.
Comment #15
gábor hojtsyThanks. I consider this a major issue, and will see if we'll need a release soon, or should do more cleanups (JS cleanups are on the way), before a new release will be out. Committed.
Comment #16
hansfn commentedThis might have been mentioned already, but here I go: Please add an option so we can choose to only show the untranslated strings. This should be easy since you already use different CSS-classes.
PS! I know I can add "display: none" to "#l10n-client .string-list li.translated" in l10n_client.css, but I want to reduce the size of the HTML too.
Comment #17
gábor hojtsy@hansfn: this would be great suggestion in a separate issue, here it looks like unrelated. Thanks!
Comment #18
hansfn commentedOK, I have just created a feature request - #1022228: Add an option so we can choose to only show the untranslated strings. I just thought the initial post was related since the size of the HTML was an issue.