Re: Feedback on the update process

yemgi wrote:

Well, in French, Guest is called Invité so you need to change the username when translating

The fact that PunBB.fr has chosen to go overboard with their translation by changing actual strings in the database does not mean that we need to take that into account. You are not supposed to be changing that. wink

27

Re: Feedback on the update process

Fair enough, in this case it will need to be an addition in the French translation of punBB1.3 to modify db_update.php to take in account this specific case

28

Re: Feedback on the update process

Smartys wrote:

You are not supposed to be changing that. wink

Well, maybe, but it still COULD HAVE BEEN translated.. and the cost in attempting to convert it is nothing for the update process.

Note for those who want to use the code i provided : it needs to be placed within the "if ($start_at == 0)" block (as we need to do it only once).

Actually, the word 'guest' should be put in the lang pack, rather than hardcoded in install.php...

Re: Feedback on the update process

Then that should be localised, not changed in the database.

Re: Feedback on the update process

It was good. Should have instructions though (I managed to figure it out on my own though)

31

Re: Feedback on the update process

elbekko wrote:

Then that should be localised, not changed in the database.

Don't understand ur point.. : it's the localization of install.php which RESULTED as a change in the database.

Can u (developers) precise me if these values in the database are NEVER USED in the soft ? (it could be the case, haven't checked..).
If so, i aggree, that change in install.php is useless... (and shoudn't be done).

This said, i don't understand why adding 8 lines to db_update.php (to deal with eventual 'badly converted' databases) is such a pbm...

There still are a lot of places where 'Guest' is used hardcoded (see post.php for obvious example), when it should rather use a lang file.
And so it uses the hardcoded form, we still have to translate these php files..

Re: Feedback on the update process

Mpok: Then you point out where it's being used hardcoded so we can make sure it uses the language files, you don't unilaterally decide to edit the hardcoded text. Otherwise, your changes only benefit you and not the wider community. They can also potentially cause problems down the line, as you see here. wink
That doesn't change the fact that you shouldn't be translating strings in the database though. And even if we tweaked db_update.php to convert the guest user (which requires changing one line, not adding eight), that wouldn't change the fact that the text shouldn't be converted in the first place.

33

Re: Feedback on the update process

@Smartys : what u seem not to understand (sry), is that the only reason of changing things in php files (and therefor in the database) is the lack of using lang files in several occasions..
If everything IS based on lang files, we won't have to change things we're "not supposing to.." smile

For the 'Guest' thing, let's take post.php :

    if (($pun_user['is_guest'] && $_POST['form_user'] != 'Guest') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))

should be :

    if (($pun_user['is_guest'] && $_POST['form_user'] != $lang_common['Guest']) || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username']))

and several lines after :

    '<input type="hidden" name="form_user" value="'.((!$pun_user['is_guest']) ? htmlspecialchars($pun_user['username']) : 'Guest').'" />'

should be :

    '<input type="hidden" name="form_user" value="'.((!$pun_user['is_guest']) ? htmlspecialchars($pun_user['username']) : $lang_common['Guest']).'" />'

I let u check other files for same stuff..

And for the other 'database changes', let's think about the 'New forum' string in install.php : this HAS to be localized also...

34

Re: Feedback on the update process

Smartys wrote:

And even if we tweaked db_update.php to convert the guest user (which requires changing one line, not adding eight)

??? You mean changing '2' to '1' ? The conversion made in the general loop is not neither applicable nor sufficient for guest user. The fields needed to be converted ARE different from common users. So u need a special treatment, and then, more lines (only thing is that the three fields are likely to be the same, so the code can be reduced from the one i've provided, but not in lines, counting commentary one).

Re: Feedback on the update process

Mpok wrote:

@Smartys : what u seem not to understand (sry), is that the only reason of changing things in php files (and therefor in the database) is the lack of using lang files in several occasions..

I'll quote myself:

Smartys wrote:

Mpok: Then you point out where it's being used hardcoded so we can make sure it uses the language files, you don't unilaterally decide to edit the hardcoded text.

Mpok wrote:

And for the other 'database changes', let's think about the 'New forum' string in install.php : this HAS to be localized also...

How wonderful for you then that Paul created lang/English/install.php wink

Mpok wrote:

??? You mean changing '2' to '1' ? The conversion made in the general loop is not neither applicable nor sufficient for guest user. The fields needed to be converted ARE different from common users. So u need a special treatment, and then, more lines (only thing is that the three fields are likely to be the same, so the code can be reduced from the one i've provided, but not in lines, counting commentary one).

No, unless Guest was translated the three times it was used (username, password, email), in which case I really think this is an issue for PunBB.fr to deal with.

Everyone: But yeah, seriously, we can't help people who want to localize PunBB if they don't tell us when they have trouble doing so. If you find a hardcoded string, point it out so we can fix it.

36

Re: Feedback on the update process

Smartys wrote:
Mpok wrote:

And for the other 'database changes', let's think about the 'New forum' string in install.php : this HAS to be localized also...

How wonderful for you then that Paul created lang/English/install.php wink

But in rev. 1478, this string has not been taken in it..

Smartys wrote:

No, unless Guest was translated the three times it was used (username, password, email), in which case I really think this is an issue for PunBB.fr to deal with.

Thanks to suppose we're THE ONLY ones to attempt to get a REAL localization (means got translated EVEN the hardcoded values), but i'm not sure we're the only ones..
And ur not sincere (as a developer) : u encounter 3 times in a row the same word u have to translate, and u just translate the first one ? (note: u didn't give me the answer at "Are these values being used somewhere ?")

Once more, this WOULD'NT HAVE HAPPENED IF ONLY THE SCRIPT WAS "localizing" (mean used lang files, which WAS NOT THE CASE). So please, don't reproach us things we're not responsible.

Smartys wrote:

Everyone: But yeah, seriously, we can't help people who want to localize PunBB if they don't tell us when they have trouble doing so. If you find a hardcoded string, point it out so we can fix it.

I DID pointed u in my previous message at least 2 of these 'hardcoded values'...

And in install.php, maybe "Paul created lang/English/install.php", but NONE of the actual strings are taken from the lang file.

Re: Feedback on the update process

Instead of doing your best to covertly insult the developers (hint: you failed), point out, in a new thread, where exactly these hardcoded strings are. All of them.

Re: Feedback on the update process

Mpok wrote:

But in rev. 1478, this string has not been taken in it..

Which is why you point these things out to us, so we can fix them.

Mpok wrote:

Thanks to suppose we're THE ONLY ones to attempt to get a REAL localization (means got translated EVEN the hardcoded values), but i'm not sure we're the only ones..

If you can point me to some other groups that are distributing translated versions with the same problem, I'd be happy to chastise them as well. It has nothing to do with you being "the only ones" (or not) and everything to do with how you went about dealing with hardcoded strings.

Mpok wrote:

And ur not sincere (as a developer) : u encounter 3 times in a row the same word u have to translate, and u just translate the first one ? (note: u didn't give me the answer at "Are these values being used somewhere ?")

I would translate just the username, yes. Nothing else is displayed publicly (and I doubt even the username is). That's why I think translating this stuff was so silly: you might as well translate the database schema and the GPL preamble at the top of the code.
And you should be able to tell me if the strings are used anywhere: since PunBB.fr translated the strings, they should know what those translations changed. wink

Mpok wrote:

Once more, this WOULD'NT HAVE HAPPENED IF ONLY THE SCRIPT WAS "localizing" (mean used lang files, which WAS NOT THE CASE). So please, don't reproach us things we're not responsible.

And once more, when we don't localize things, you should be reporting them to us so we can do so. You shouldn't be modifying the core files in order to create a language pack (although I know PunBB.fr created its own parallel version to get a "complete" translation of certain untranslatable features in 1.2, like the admin panel and install.php). The developers are not the ones creating localizations in most cases: thus, we can only know if something is needed if you tell us.

And as Bekko said, there's really no point in continuing this conversation. If you find hardcoded strings, tell us so we can deal with them. The database update script likely won't deal with mistranslated strings unless we find that it causes an issue and that a great number of people are affected by it. End of story. wink

39

Re: Feedback on the update process

In the futur, if he are a modif of db_update for convert all data of database in UTF-8???

Re: Feedback on the update process

Huh? I'm not completely sure what you're trying to say, but the database update script is supposed to convert all PunBB data to UTF-8.

41

Re: Feedback on the update process

No all characters are not convert.
They are in type: éèà....

You can view this here

Re: Feedback on the update process

Did you do that conversion with the version of db_update.php from SVN? If not, it would be great if you could try it again and see if that fixes your problem.
If it doesn't, it would be great if you could send either Rickard or me a copy of your 1.2 database to work with to try to track down the issue.

43

Re: Feedback on the update process

Yes i wiil execute the lastest db_update from the SVN. I will send my database to you.
Their are no modifications of this, its the original database from 1.2.6 to convert 1.3 with db_update

Re: Feedback on the update process

For anyone curious, the issue was not with the conversion process but with the MySQL dblayer. smile

45 (edited by Jérémie 2008-02-21 05:59)

Re: Feedback on the update process

Rev 1507: I've tried the db_update tool (with charset convers disabled, since it's a 1.2 utf8 database), and at the end when trying to access the new install, I've got a ?There is no valid language pack 'Francais' installed. Please reinstall a language of that name.? error. I've tried editing the o_default_lang field of the config table to ?English?, same error (yup, the same).

Apart from that, I got at the end of the db_update script only this "error" : Notice: Undefined variable: cookie_name in MyPath/db_update.php on line 1113

Also, one thought: ?Current character set: If the primary language in your forum is English, you can leave this at the default value. However, if your forum is non-English, you should enter the character set of the primary language pack used in the forum.? This could benefit from a link to the documentation, explaining charsets and the ones used

Re: Feedback on the update process

Rev 1507: I've tried the db_update tool (with charset convers disabled, since it's a 1.2 utf8 database), and at the end when trying to access the new install, I've got a ?There is no valid language pack 'Francais' installed. Please reinstall a language of that name.? error. I've tried editing the o_default_lang field of the config table to ?English?, same error (yup, the same).

Did you delete the cache file after that?

And an unknown cookie_name? Do you not have it set in your config.php? hmm

Re: Feedback on the update process

Smartys wrote:

Did you delete the cache file after that?

Nope I didn't. It worked smile

The result is fine. The update seems to have worked.

So, it seems those steps should be covered by the update script.

And an unknown cookie_name? Do you not have it set in your config.php? hmm

Iirc, the update script gave me the new config file, and this field was empty (I didn't touch the new config file at all during that test).

Re: Feedback on the update process

I was referring to your old config file, not the one that was generated.

Re: Feedback on the update process

In MySQL, the subject/message are stored as: Happy Valentine´s Day

In 1.2.17, the subject/message are displayed as: Happy Valentine´s Day
In 1.3, the subject/message are displayed as: Happy Valentine´s Day

How to fix?

Thanks.

Re: Feedback on the update process

We need more details then that. For example:
A. What was the charset used to insert that data into the database/present it in 1.2.
B. What was the collation of the database tables in 1.2.
C. Did you choose to have the data converted to UTF-8? If so, what collation did you give to convert from?

If you're using the mysql dblayer, make sure you're using the latest copy from SVN.