Closed (fixed)
Project:
Coder
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
4 Dec 2008 at 07:29 UTC
Updated:
4 Sep 2012 at 20:31 UTC
Guys,
if i have a string like "Area" but the translation is "Área" (unicode), Coder wrongly detect it as different first letter case.
The fix to be placed on coder_i18n.inc, around line 123, replace:
// Check the translation first capitable letter.
if (ctype_upper($msgid[0]) != ctype_upper($msgstr[0])) {
$rule = array(
'#warning' => "The first letter in the translation text should have the same capitalisation as it's original text.",
);
_coder_error($results, $rule, $severity_name, $lineno, $msgstr);
}
to
// Check the translation first capitable letter.
$first_msgid = drupal_substr($msgid, 0, 1);
$first_msgstr = drupal_substr($msgstr, 0, 1);
if (($first_msgid == drupal_strtoupper($first_msgid) and $first_msgstr != drupal_strtoupper($first_msgstr)) or
($first_msgid == drupal_strtolower($first_msgid) and $first_msgstr != drupal_strtolower($first_msgstr))) {
$rule = array(
'#warning' => "The first letter in the translation text should have the same capitalization as it's original text.",
);
_coder_error($results, $rule, $severity_name, $lineno, $msgstr);
}
regards,
massa
Comments
Comment #1
douggreen commentedComment #2
douggreen commentedThis has not been fixed yet, but the solution here looks a little complicated. I'm going to ask @gabor to comment.
Comment #3
gábor hojtsyI would not say that there is an easy way or any way for that matter that Drupal core uses to tell whether characters are collated to the same character but lowercase/uppercase. Theoretically I don't see anything wrong with this patch. Have not tried it.
Comment #4
douggreen commentedThanks, Committed to 7.x-2.x http://drupalcode.org/project/coder.git/commit/f10b66e