PDA

View Full Version : lowercase?



mherger
2005-03-22, 04:19
Some routines convert strings to lowercase (eg.
Slim::Web::Pages::_lcPlural()). Why this? German (and others, I guess,
too) is case sensitive.

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Robert Moser
2005-03-22, 10:04
Michael Herger wrote:
> Some routines convert strings to lowercase (eg.
> Slim::Web::Pages::_lcPlural()). Why this? German (and others, I guess,
> too) is case sensitive.
>

Chalk it up to unilingual programmers attempting to do I18N. I'm
guessing that it was intended to avoid having to have separate strings
for lower case and mixed case versions of the same word.

mherger
2005-03-23, 08:06
>> Some routines convert strings to lowercase (eg.
>> Slim::Web::Pages::_lcPlural()). Why this? German (and others, I guess,
>> too) is case sensitive.
>
> Chalk it up to unilingual programmers attempting to do I18N. I'm
> guessing that it was intended to avoid having to have separate strings
> for lower case and mixed case versions of the same word.

And how can I convince some of these unilingual programmers to get my
uppercase back? :-)

--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)

Robert Moser
2005-03-23, 08:57
Michael Herger wrote:
>>> Some routines convert strings to lowercase (eg.
>>> Slim::Web::Pages::_lcPlural()). Why this? German (and others, I
>>> guess, too) is case sensitive.
>>
>>
>> Chalk it up to unilingual programmers attempting to do I18N. I'm
>> guessing that it was intended to avoid having to have separate
>> strings for lower case and mixed case versions of the same word.
>
>
> And how can I convince some of these unilingual programmers to get my
> uppercase back? :-)
>
You've already done step 1: Letting the linguistically challenged know
that Capital letters aren't just for the Beginnings of Sentences anymore.

Now comes step 2: Figuring out a way to be able to get the
capitalization correct across different languages without creating a
huge number of new strings.

That second part involves analyzing where the _lcPlurals are being used.
Then possibly moving that function to Slim::Util::Strings and
supplying some rules based on the languages as to whether or not to
capitalize.

For example, we could make a string for MIDWORDS_LOWER, which would be 1
for EN and 0 for DE. Then apply the lc() function based on that.

mherger
2005-03-23, 13:38
On Wed, 23 Mar 2005 07:57:25 -0800, Robert Moser <rlmoser (AT) comcast (DOT) net>
wrote:

> Michael Herger wrote:
>>>> Some routines convert strings to lowercase (eg.
>>>> Slim::Web::Pages::_lcPlural()). Why this? German (and others, I
>>>> guess, too) is case sensitive.
>>>
>>>
>>> Chalk it up to unilingual programmers attempting to do I18N. I'm
>>> guessing that it was intended to avoid having to have separate
>>> strings for lower case and mixed case versions of the same word.
>> And how can I convince some of these unilingual programmers to get
>> my uppercase back? :-)
>>
> You've already done step 1: Letting the linguistically challenged know
> that Capital letters aren't just for the Beginnings of Sentences anymore.

Even worse: upper-/lowercase isn't all that should be fixed in that phrase
("xy albums with yz songs..."). There should also be an accusative :-)

> Now comes step 2: Figuring out a way to be able to get the
> capitalization correct across different languages without creating a
> huge number of new strings.
>
> That second part involves analyzing where the _lcPlurals are being used.

In one single sub.

> Then possibly moving that function to Slim::Util::Strings and
> supplying some rules based on the languages as to whether or not to
> capitalize.
>
> For example, we could make a string for MIDWORDS_LOWER, which would be 1
> for EN and 0 for DE. Then apply the lc() function based on that.

Something like this:

Index: /home/mh/eclipse/SVN/Slim/Web/Pages.pm
================================================== =================
--- /home/mh/eclipse/SVN/Slim/Web/Pages.pm (revision 2688)
+++ /home/mh/eclipse/SVN/Slim/Web/Pages.pm (working copy)
@@ -526,7 +526,10 @@
sub _lcPlural {
my ($count, $singular, $plural) = @_;

- return sprintf("%s %s", $count, lc(($count == 1 ? string($singular) :
string($plural))));
+ # only convert to lowercase if our language does not wand uppercase
(default lc)
+ my $word = ($count == 1 ? string($singular) : string($plural));
+ $word = (string('MIDWORDS_UPPER') ? $word : lc($word));
+ return sprintf("%s %s", $count, $word);
}

sub addLibraryStats {
Index: /home/mh/eclipse/SVN/strings.txt
================================================== =================
--- /home/mh/eclipse/SVN/strings.txt (revision 2688)
+++ /home/mh/eclipse/SVN/strings.txt (working copy)
@@ -8705,3 +8705,7 @@
WMA_NO_CONVERT_CMD
DE Fehler beim WMA Konvertieren - bitte Dateityp überprüfen
EN WMA convert error - check file types
+
+MIDWORDS_UPPER
+ DE 1
+ EN 0
\ No newline at end of file


--

Michael

-----------------------------------------------------------
Help translate SlimServer by using the
StringEditor Plugin (http://www.herger.net/slim/)