Relevant portion of O Govinda's commentary from http://drupal.org/101090:
Home » Administer » Help » Locale
NOW:
. . . replace given built-in text with text which has been customized for your site. Whenever the locale module encounters text which needs to be displayed, it tries to translate it into the currently selected language. If a translation is not available, then the string is remembered, so you can look up untranslated strings easily.REVISED:
. . . replace given built-in text with text customized for your site. Whenever the locale module encounters text which needs to be displayed, the module tries to translate it into the currently selected language. If a translation is not available, the module remembers the string so you can look up untranslated strings easily.NOW:
The locale module provides two options for providing translations. The first is the integrated web interface, via which you can search for untranslated strings, and specify their translations. An easier and less time-consuming method is to import existing translations for your language.REVISED:
The locale module offers two ways to provide translations into your language. The first is to use the integrated web interface to search for untranslated strings and specify their translations. An easier and less time-consuming method is to import an existing translation.NOW:
Translations for many languages are available for download from the translation page.REVISED:
Translations for many languages are available for download from the TRANSLATIONS PAGE AT DRUPAL.ORG. [link]NOW:
If an existing translation does not meet your needs, the .po files are easily edited with special editing tools. The locale module's import feature allows you to add strings from such files into your site's database.REVISED:
If an existing translation does not meet your needs, the .po files are easily edited with special editing tools you can find on the web. [MY COMMENT: On Drupal.org?] The locale module's import feature allows you to add strings from edited files into your site's database.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | locale-text-10.patch | 30.61 KB | keith.smith |
| #22 | locale-text-9.patch | 30.61 KB | keith.smith |
| #20 | locale-text-8.patch | 28.03 KB | keith.smith |
| #18 | locale-text-7.patch | 28.26 KB | keith.smith |
| #16 | locale-text-6.patch | 28.28 KB | keith.smith |
Comments
Comment #1
keith.smith commentedI started work on the text in locale.module, but a patch here would conflict badly with http://drupal.org/node/175876, so I'll wait a bit and see if that patch makes it in.
Comment #2
keith.smith commentedA few remarks about this patch:
So, please review!
Comment #3
gábor hojtsyReviewed:
- Example: Using "de" as a value for German forms URLs to German content in the form www.example.com/de/node does not sounds quite right. Too many "forms". Also, the existing example with "deutsch" was more "fun" (you can set arbitrary prefixes).
- This value is used in Domain language negotiation. This value is not used in None and Path language negotiation schemes. sentences will look better if connected with a "however" or something along those lines IMHO.
- Example: Using "http://de" as a value for German forms URLs to German content in the form http://de.example.com/node. is not right. You need to provide the full domain name with protocol. Such as de.example.com/node in this case. The existing example was also more "fun" here, also suggesting http://example.de as a possibility.
- Actually LANGUAGE_NEGOTIATION_NONE always uses the site default language for page display regardless of anything else. Users are still allowed to set their languages, as for examples emails sent to them are sent in their preferred language.
- A strong tag was not closed in the negotiation description
- ... skipped a few very long things here (being tired :) to the end ...
- This block is only shown if your site display language is determined by using a custom domain is not right, as you explain in the same sentence later. The block is shown if there is some language negotiation (ie. not none). Whether it is domain or path based does not matter.
- Path aliases used to select a site display language take precedence over all other aliases set for the same path. does not sounds too easy to understand. Although paths are saved with language informaiton, it is not entirely true, that the path will select the language. If 'contact' has a 'contacto' alias in language xx and 'contacte' alias without a language set, when a link to the contact page needs to be displayed on a page in xx language, 'contacto' is used. All other languages use the 'contacte' alias. Whether this alias will be prefixed by a path or a domain depends on the setting. So the path alias itself does not contain the language, and paths are not always used to select languages anyway, so there are two things why your version is not correct.
That's it for now, the stuff I skipped I did not review.
Comment #4
keith.smith commentedthanks Gábor!
I know this one is a pain to review, especially when I don't quite [yet] understand what everything is doing. I appreciate your patience.
I:
-- fixed the missing strong tag.
-- reworded the negotiation sections from above, taking your advice and restoring the "fun" examples (which actually are more illustrative). After thinking about it, is is likely that this section did not do exactly what I thought it did -- I now think it does something very simple, elegant and powerful: allow the user to input a variable string that, when matched within a displayed link, selects that language.
-- reworded LANGUAGE_NEGOTIATION_NONE based on your comments above.
-- fixed my error on the "This block is only shown if your site display language is determined..." string.
-- reworded the "Path aliases used to select a site display language take precedence over all other aliases..." string to say "A path alias set for a specific language will always be used when displaying this page in that language, and takes precedence over path aliases set for All languages."
Comment #5
keith.smith commentedAfter sitting on this for an hour or three, I found a few inconsistencies in my earlier patch. New patch attached. This version is untested, however.
Comment #6
gábor hojtsyJust noticed while testing a fix for http://drupal.org/node/194743 that the domain can indeed be left empty for the default language. The right help text there would be that it can be left empty for the default language. If left empty otherwise, that language will be inaccessible. (Understandably the system will not have a URL to match to that language).
Comment #7
keith.smith commentedthanks for your comments, Gábor -- I learn a bit more about this every time I read one of them.
The attached patch adds in the note from #6, and dramatically modifies the /admin/settings/language/configure screen (screen shot attached). This may be an unorthodox way to provide an explanation for the setting on this page in this manner, but:
-- this is a complex radio button, and there is no good way to provide the information needed actually on the options themselves.
-- I've already seen at least one and possibly two issues about the longer options being cut off as they passed the left margin, as they do not appear to wrap. Moving the explanatory text into the help text above prevents this.
Comment #8
gábor hojtsyHm, I took some time to read through this. First, many of the texts are highly improved since the ones before the patch, so this is a great improvements. Indeed, it is quite important to help our users as much as possible in understanding these new features. Some notes:
- "language packs" is not an actually accepted / agreed on term. Maybe "language packages" or better "translation packages" are a better name. We try to refrain from abbreviation, and what's in these packages are translations.
- adding languages not only allows users to import stuff or translate the interface, but also to post nodes in those languages (ie. blog posts in different languages), on which the content translation module adds the node translation feature, which also allows node translation to the languages set up here
- import does not import "language packs" but only single .po files from these packages... .po files from translation packages are imported automatically on module install, theme enable and language addition time, if present in the Drupal directories
- exporting template files to "modify translations" is quite pointless as they don't contain translations
Comment #9
hass commentedUse double quotes for the following string to remove the backslash, please.
same here:
and some more strings... review all changes regarding this type of bug, please.
Comment #10
keith.smith commented@9: In the attached patch, I hope that I adjusted the delimiters properly, but a review is always helpful. Thank you for your comments.
@8: Thanks especially for your comments!
-- I've standardized on "translation packages" at your suggestion, and this patch includes modifying text in install.php to that end.
-- I've added a brief mention on the /admin/settings/languages page to indicate that the enabled languages are also used when creating posts of multilingual content types. If I need to add additional language to tie this in to the translation module I will be happy to do so.
-- /admin/build/translate/import should now explicitly note that import is for a single .po file that needs to occur in non-automatic-import time.
-- On exporting template files, I've modified the text on the /admin/build/translate/export page to reflect that a template file export is useful in creating new translations in the form of .po files.
Following up on this last point, though:
is this text correct: For translation tasks involving many strings, it may be more convenient to export strings to a desktop Gettext translation editor. Should this say, uh: To create a new translation, it may be more convenient to export a template file containing the original strings for use in a desktop Gettext translation editor. (or something similar). I'm unclear on what these desktop editors can and cannot edit.
Comment #11
gábor hojtsyAbout the last point: desktop editors can be used to edit whatever gettext file you throw at them. Depending on what tools will be available for Drupal 6 (we have fine module ideas :), exporting to external tools might turn out to be less comfortable. With Drupal core, without more modules, on-site translation editing of multiple English strings is quite tiresome, and exporting and reimporting is still better. So either creating a full translation or translating some stuff could be better in external tools, if we take Drupal core only.
I don't have the time, but will review the other changes later. Thanks!
Comment #12
keith.smith commentedThanks for the quick reply. I understand your comment to be that if the .po file you use with the Gettext editor contains the translated version of the string, then you can use this editor to make changes in the translated version (but would then presumably have to reimport that changed file at the import page). It is only when one is using the editor to read the template version of the file that does not include the translated strings that one, of course, does not have translated strings to edit (and thus, would best use this for creating new translations).
If I understand that correctly, then the text is probably ok the way I have it. I just wanted to make sure that the editor was not used to ONLY create new strings, but that, given a translation, could edit that as well.
Comment #13
gábor hojtsyYes, Gettext editors do editing, merging, spell checking and all kinds of fun stuff, which Drupal does not do. So that's why the import and export feature exists (plus to let you share your translations, etc).
Comment #14
gábor hojtsyReviewed the latest patch. My comments
- The language domain misleadingly suggests that it is just a "language code or..." (text seemingly copied over from the path prefix). While the path prefix is really only a language code or special text identifying the domain, the domain is not. It is actually a language "base URL", but base URL is not a concept used elsewhere on the user interface.
- Gettext is named "GNU Gettext" at only one place. IMHO we don't need GNU there, or we need to include GNU at all places for consistency.
- I don't understand this, and expect that others might not understand as well: "language of posts with multilingual support may be indicated"
- Help text for admin/settings/language still says that the import page imports a translation package. This is not true. When a translation package is extracted to the Drupal source folders (in the structure as indicated in the translation package) and a new language is added, the translations for installed modules and themes are imported automatically. The import screen can only be used to import .po files one by one. With 20+ enabled modules it is much easier to extract the translation pack first, then add the language and let Drupal import the files automatically (with a nice progress bar is displayed on the screen :), instead of importing them one by one.
- admin/settings/language/add help has the same problem, and it calls packages packs :)
- in the admin/build/translate help, the "site translation" term seems to be misleading to me. We have interface translations, but the site can have menus, taxonomies, nodes, uploaded files, etc. which are not managed on the admin/build/translate page. Here, again, translation packs cannot be imported on the import page.
- import help: "This page allows for the import of individual Gettext Portable Object (.po) file" seems to be a typo. An s is missing from the end of the sentence? Although the second part of the text talks about automated imports, the first talks about importing packages on the web interface again :)
- search: "and is used when building a new or editing an existing translation" seems like missing someone around "new"
So to give some background, here is a sample translation package attached. It is the Hungarian Drupal 6 translation in-progress. The files are about to fall into place into the different places where translations are loaded from. When Drupal is installed with a translation package in place, the installer goes through in that language, and all translations for all installed modules and themes are imported. Later when a module is installed or a theme is enabled, translations in all enabled languages are imported. When a new language is added, if the translation package files are found extracted into the Drupal folders, they imported. Because a (Drupal core) translation pack like this for Drupal 6 contains so many .po files, and it also a tar.gz file, we are not doing imports of packages themselfs on the import page. We do imports of individual .po files however. These could be .po files you translated for example.
I hope this gives some background, which helps driving these changes home (getting them into Drupal) :)
Comment #15
keith.smith commentedThis is one of the few modules with help text unaffected by http://drupal.org/node/197297#comment-652207 (because I skipped those comments knowing that this issue was here).
Gabor, in #14, you mention a lot of points, thank you for the detailed review. I'm going to work on addressing some (or all) of your points over the next couple of hours, so I'm going to assign this to myself for the interim.
Comment #16
keith.smith commentedGábor @ 14:
That last patch I uploaded was bunk. I was very unimpressed with it when I read through it this last time.
I have not much confidence, though, that this one is an improvement, so I'm tempted to leave at CNW. However, string freeze looms large, and this would be nice to get in, so I'm going to set it as CNR to [potentially] speed up reviews.
I attempted to address this point.
My brain is apparently composed largely of oatmeal. I hope that I have these consistent now. I nuked GNU. :)
See above comment. Who knows what I meant.
I reworked this stuff extensively. I feel like there are still problems in there somewhere, but I probably won't see them until after I let this rest a bit.
hopefully fixed.
Comment #17
keith.smith commentedBTW: thanks for the Hungarian translation package. I downloaded, extracted and added it, and everything imported fine. I played around with it a bit -- this is all very neat. One thing I did notice -- I seemed to only be able to mark the language of a post when creating new content, not when editing existing content (i.e.: I had some example pages on my site prior to adding the language, and after enabling multilingual support : Enabled with Translation, I could specify a language on new pages but not previously existing pages. This is probably the way it is supposed to be, but I should probably make sure my help text, above, reflects that distinction.
Edit: Ignore me. I tried this again (editing a page), and it worked fine. May have been a caching issue or something.
Comment #18
keith.smith commented*sigh*
I apparently cannot get this patch completely right. I just read through the patch in #16 and found what is hopefully the last reference to "translation pack". I fixed that, and corrected two or three small issues with word flow.
Comment #19
gábor hojtsy- I bet this needs to be rerolled with the "For more information..." changes, as it will not apply anymore.
- The main help on admin/help#locale still only talks about interface translation, while this module provides the language association for nodes and paths aliases, as well as as language negotiation for incoming requests; these should be mentioned
- There is a "translation pack" instance still here: "automatically import files from a translation pack"
- This sentence seems to be too "determined" :P "Language negotiation settings determine how the site's presentation language is determined."
- Maybe admin/build/translate/import elaborates on what a translation package is too much? Also first it explains what is in it, and then explains it generally, quite strange.
Otherwise the changes look nice. Most of the above are small issues, so they will hopefully be easy to fix soon :)
Comment #20
keith.smith commentedThe attached rerolls the prior one so that it will apply, and makes the following changes:
fixed. I apparently just can't find those. I even used a search on the earlier patch, and still didn't see it, apparently. :)
bleh. fixed.
Quite strange indeed; now fixed. I took out most of that last section, so hopefully this is less weird.
What I have not done yet is this:
so I'm going to leave this at CNW.
The language negotiation I get, I think, and should be included. I am not 100% certain about the last part of your note, though. When you say "language association for nodes and path aliases", you're meaning the ability to have language-specific aliases, and to note the language that a particular node is authored in? Or something else?
Comment #21
gábor hojtsyYes, I mean exactly this. Sorry for not being clear enough.
Comment #22
keith.smith commentedPlease don't apologize -- indeed, the fault was mine. I had the [mistaken] idea that this was handled by translation module.
This patch adds the following text to the locale module help:
And, since locale module links to translation module help, I added a link in translation module help back to locale module.
Please review.
Comment #23
keith.smith commentednone should be None.
Comment #24
gábor hojtsyThis all looks fine to me know, so committed. Thanks a lot for your great work!
Comment #25
keith.smith commentedOh. My. God.
I was about to suggest that we "won't fix" this to save you the time and trouble. Thanks for reviewing it again, and thanks especially for sticking with me on this one -- locale and content have a large feature set, and some of them are not immediately obvious to those of us who do not run multilingual sites. This issue has convinced me, though, that locale and translation are the unsung heroes of the Drupal 6 release. I guess everyone else already knew this, but I'm really amazed at what they do. Everyone involved in those modules should pat themselves on the back.
I know I've been spending a lot of time on help text lately, as have other folks. I'm pretty happy to be doing that, because I think about translators -- and what they do -- and shake my head with some amazement. I say this having written some very confusing bits here and there: there are places in Drupal where I have to read the English version two or three times to figure it out. That a translator can read it (sometimes with limited English skills), determine what it is *supposed* to say, and then properly translate it to another language is pretty impressive.
I do pretty much believe that no one reads help text, but obviously translators do -- it would be very interesting to get feedback on what areas of the interface are (especially) hard to translate, so that we can take a second look there. That may already be a feature of the localization server (which I've only recently started following).
Anyway -- thanks Gábor!
Comment #26
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.