Closed (fixed)
Project:
XML sitemap
Version:
6.x-1.x-dev
Component:
xmlsitemap
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Nov 2007 at 01:00 UTC
Updated:
6 Jan 2009 at 08:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
hass commentedPatch attached to solve this problem.
Comment #2
darren ohCan you give an example of what could go wrong?
Comment #3
hass commentedYep, In German i translate
content type settingswithEinstellungen für Inhaltstypen. If i translate the full sentenceThe default priority for specific content types can be set on the !link pagesit would end withDie Standardpriorität für spezische Inhaltstypen kann auf der Seite !link eingestellt werden.. If i mix both together i get big sh**Die Standardpriorität für spezische Inhaltstypen kann auf der Seite "Einstellungen für Inhaltstypen" eingestellt werden.. It would better beDie Standardpriorität für spezische Inhaltstypen kann auf der Seite für "Inhaltstypen" eingestellt werden.what only means 'content types' and is the translated title of the content type page made by core translators. What you does here is not context sensitive. If someone will start reusing (or already doing) the string thecontent type settingsit may need a different meaning or accent. Often you need to attach an S somewhere or remove it on a other situation in German... other language have much more difficulties here.However you understand the German above or not - there was a consense with the core developers to make strings more context sensitive. I lost the case number with this discussion... but Garbor said - that such context less strings will create big difficulties in translations... thats all. It simply make translators live much easier... i know my other languages are much much more context sensitive then German <> English.
Comment #4
darren ohI must be misunderstanding something. My purpose in writing the string as it is was to keep HTML out of it. Your suggested change puts the HTML back in the string. A link to the discussion would be helpful.
Comment #5
hass commentedI will try to find this discussion again... but you could also take a look into D6 core and how it is done there.
Comment #6
darren ohI'm going to save this for the Drupal 6 branch.
Comment #7
hass commentedonly one example from today: http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/system/system.inst...
Comment #8
darren ohSorry for the "won't fix." I'm changing this to by design for the Drupal 5 version. Hopefully the guidelines for converting modules to Drupal 6 will address this question.
Comment #9
avpadernoI am changing the status to fixed to make the report close automatically after 2 weeks.
I am changing the category as the report doesn't describe a bug of the code.
Comment #10
hass commentedThis is a bug. Please read the t() docs http://api.drupal.org/api/function/t.
Here is an example of incorrect usage of t():
Have the patch been committed?
Comment #11
avpadernoIn this case, this is a duplicate of #345654: Correct the calls to t().
Anyway, the report topic was about Translation may be context sensitive, and not about the incorrect usage of
t().Comment #12
hass commentedChanging back, patch is above and needs review. We change the topic here. No need for a new case.
Comment #13
avpadernoThe report refers to 5.x-1.2 which is an obsolete version.
The only versions which take fixes are 5.x-2.x-dev, and 6.x-1.x-dev which are changed to reflect the code I am using on the version of the module I am developing internally.
I am changing the category because the report is about the choice of strings to use; the change proposed was to make easier for who translate the module to a different language, not because the module was not working correctly.
As a matter of fact, the versions which receive the bug fixes are available only in English.
The incorrect use of
t() is another issue, that is completely separated from the current one. There is already a report about that.Comment #14
hass commentedThen move this to the latest version. THIS IS A BUG that was filed at 1.2 times - nothing else. Patch is here http://drupal.org/node/192939#comment-632339
Comment #15
avpadernoThere we go.
The code has been changed in 5.x-2.x-dev; therefore the patch does not apply anymore.
Repeating myself, the use of a word in a UI is not a bug. If it would be so, then all the times a module uses a word that for me is not correct, I could report a bug.
Comment #16
hass commentedPatch updated for D5 2.x.
If a patch no longer applies set a case to CODE NEEDS WORK, but never close it.
Comment #17
avpadernoThe patch also changes Site map into XML site map which was object of a different report to which Darren Oh replied that he was not going to change it if he would not have seen a real need to change it.
The line
return 'unsupported type '. $type .'for xmlsitemap_placeholder';doesn't need to be localized because it's not shown to the end user. That function, that is a port of a function existing for Drupal 6 (db_placeholder()) should return a placeholder to be used for the data type passed to the function; when the function get an invalid argument, it returns that value that will cause the query to fail, and will be only visible in the log that reports the query which caused the error.Being reported inside a query that use English words, it doesn't have any meaning to be translated; if that would be the case, then also the SQL queries that update.php shows in the final report would need to be translated.
For the change from Site map to XML site map I will open a task report; if that task is reported by other people to be necessary, then I will make the necessary changes.
Comment #18
hass commentedIs
return 'unsupported type '. $type .'for xmlsitemap_placeholder';used in a watchdog message?Comment #19
avpadernoNo, it is not.
The string returned should be normally something like '%s', %f, used to build the query. When the function gets a value for
$typethat the function is not able to handle, it returns a value that makes the query fail, as it takes the assumption it gets a wrong value because something else is wrong in the code, somewhere.Anyway, the Drupal 6 code doesn't return a translated string in the function I back ported to Drupal 5, so I don't see any reason to do it in the code I wrote, which is merely a copy of code existing in Drupal 6.
Comment #20
avpadernoWell, I could close it because the only string subject of the patch was already modified.
Patch (code needs work) would mean there are some changes to be applied; in this case, the change would have made the patch an empty file.
Comment #21
avpadernoThis report is partially matching #345654: Correct the calls to t().
You keep to say they are two different issues, then in your patch there would not be any corrections that change the call to
l()into a call tourl()As that change is already reported in that task report, it should not corrected in this issue.Comment #22
hass commentedUpdated patches attached to fix all translatable string issues in the module.
Comment #23
hass commentedComment #24
avpadernoThe patch needs to be changed as more code has been ported from the Drupal 6 branch I am developing internally.
The back-port also includes the use of translatable strings used in the priority settings that before used values like
'1.0','0.9','0.8'without to pass them tot().Having corrected the use of a wrong function, the category can now be changed; bug report usually refers to code bugs.
Comment #25
hass commentedRe-roled patches.
D6: You need to fix one bug by hand. There is one char in the string that cannot be fixed with a patch file. Search for
t('This number will be multiplied by the ratio of the number of comments on a post to the highest number of comments on any post. After the word "post" you see a rectangle.Comment #26
avpadernoThe description strings used in the implementation of
hook_schema()are all passed tot()like is evident in the documentation; if you then see how the core modules implement that hook, you will see they all do the same (just to make an example, book_schema(), node_schema()).This issue is referred to 5.x-2.x-dev; let us change the code in that version, and pass to 6.x-1.x-dev successively.
Comment #27
hass commentedThe hook_schema() stuff no more needs to be translated. You are not up-to-date and the docs are also not up-to-date! See #332123: Remove t() from all schema descriptions. Simply commit the patches and do not discuss any longer, please. I'm one of the most if not the most active developer about translatable string fixes. I know very well what I'm talking about and how it should looks like.
Comment #28
avpadernoYour affirmation is not completely true, as the issue has not been fixed.
I would remind you that you were suggesting to to make translatable a string used by a port made by me, when even the original code passed that string to
t().Then I would make you notice that wrong patches are not accepted, whomever submit them; it could be even the Pope, but a wrong patch still is a wrong patch.
To complete, the report is for 5.x-2.x-dev which doesn't even have a schema API.
Comment #29
avpaderno'@'should be used only for input got from external sources, and I am not sure that is always true when you use it.I would suggest you to not submit any patches, as I am still porting the code I internally developed to the development snapshots.
Comment #30
hass commentedSee the t() examples in the API docs together with url(). All are using @. I can also not remember the url, but we should use "@" by default and "%" for titles inside a string and "!" only if we need to pass something as is into the string (for e.g. HTML code that must not run through check_plain).
About the schema API changes - you may not aware about the persons who are listed in the tread, but if Gabor say - he will commit and support this change, be assured this will get committed very soon. I expect this will happen for Drupal 6.9. There is no more any discussion if this change should not be done or not. So don't waste translators valuable time and remove them.
Feel free to change the Version selectbox after you committed the D5 patch to D6. This is the way we work for ages if we discuss general bugs and finally if patches for multiple versions have been appended. There is NO need to have extra cases for every version with the same issue.
Comment #31
avpadernoUntil the referring version is 5.x-2.x-dev all the patches must focus on that version; adding a patch for a version for which the issue has not been opened creates just confusion on who follows the report.
I hope we agree on this.
Comment #32
avpadernoAs far as I can read, the differences between the placeholders for
t()are the following:That means that, if I don't need to pass the value which replaces the placeholder through
drupal_validate_utf8(), orhtmlspecialchars()(which is whatcheck_plain()does) I would not use'@'.It could even happen with the input received from the user, if the input is, i.e., converted into an integer with
(integer) $input, and then it is used in a string (which normally happens if that value is output into a Drupal page). In such case both the functions (drupal_validate_utf8(), andhtmlspecialchars()) are useless: a string which contains digit characters is surely valid UTF-8, and it surely doesn't contain HTML characters that must be escaped.Therefore the assumption that
'@'placeholder strings must be used by default must be reviewed.Comment #33
avpadernoThis has been fixed in CVS for 5.x-2.x-dev.
I will change the code for Drupal 6 branch as well, later.
The code still uses the !variable placeholder when the value which replaces it is a constant string or it's a value that is an integer (I also added a simple check on the value returned by a function to be sure the value is an integer).
There is still something that needs to made better. The string
'!sitemap submitted to !engine'(with'!sitemap'being replaced by'Site map index', or'Site map') should be changed, as it maybe opens again the problem of a translatable string given without a context; I don't know if this is the case, but it could be that site map is translated in more than one way in some languages.Comment #34
avpadernoThe only solution I can find is to simply use Site map submitted to !engine. It could be confusing to read the same message repeated more than once in row in the log, but I don't think it's requested this level of detail, in this case.
Comment #35
avpadernoI also applied the change I was talking before in CVS.
I will make the necessary changes for the Drupal 6 branch later; the commit for Drupal 6 will be delayed, as I am changing the development snapshot code to the code I was testing internally.
I am setting the status to fixed until I don't change the referring version to 6.x-1.x-dev.
Comment #36
hass commentedComment #37
hass commentedComment #38
avpadernoComment #39
avpadernoComment #40
avpadernoThe changes have been committed in CVS.