Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By bjergtrold on
Hi, I'm testing Drupal 4.1.0rc and want to use a german translation.
I have a problem with the locale module. Sometimes there are two nearly identical phrases, only different in the case of some letters (example 'Delete account' and 'delete account'). For some reason only one of those phrases appears in the locale list, so I can't translate the other one.
Is this a bug?
Comments
Easy to fix but ...
It is easy to fix but we need a comparison operator that is (a) case-sensitive (or binary) and (b) ANSI SQL compliant.
Could someone try the queries below using PostgreSQL:
SELECT STRCMP('text', '<b>t</b>ext');<br />SELECT STRCMP('text', '<b>T</b>ext');<br />SELECT STRCMP('text', BINARY '<b>T</b>ext');<br />SELECT BINARY 'text' = BINARY '<b>t</b>ext';<br />SELECT BINARY 'text' = BINARY '<b>T</b>ext';
Using MySQL, this yields:
Note that the comments on this page in the MySQL manual suggest that STRCMP is not case-sensitive by default, which is why we'd need the
BINARY
prefix.Can't you just...
Do something along the lines of
SELECT ('text'='text');
Under MySQL?
t and f refer to True and False, of course. I believe that PHP turns these into 1 and 0 on a select, but I'll have to check.
[teamonkey]
We can't
We can't (and that is exactly the problem we are trying to solve):
Did any of the queries in my previous comment work using PostgreSQL?
Nope
No - there's no STRCMP function.
Not sure how to go about this. Maybe we need a wrapper funtion for both postgres and mysql?
[teamonkey]