Two small language string use related bugs for multilingual SMF

Started by agridoc, April 15, 2012, 01:30:12 AM

Previous topic - Next topic

agridoc

Noticed here in simplemachines.org, tested and confirmed in SMF 2.02 installation, not tested for 1.1x.

Member's language is the language selected in a multilingual SMF installation.

- In notification email for new topic the team regards language string $txt['regards_team'] is in poster's language. In notification email for replies the team regards language string $txt['regards_team'] is correctly in email recipient's language.

- In PM, if no subject exists, the no subject string $txt['no_subject'] is used from sender's language not recipient's as it should. Can be confusing in notification emails.

Nothing serious, a notice for proper internationalization - localization of SMF.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

emanuele

Quote from: agridoc on April 15, 2012, 01:30:12 AM
- In notification email for new topic the team regards language string $txt['regards_team'] is in poster's language. In notification email for replies the team regards language string $txt['regards_team'] is correctly in email recipient's language.
That sounds like a bug...
* emanuele goes check. :P

Quote from: agridoc on April 15, 2012, 01:30:12 AM
- In PM, if no subject exists, the no subject string $txt['no_subject'] is used from sender's language not recipient's as it should. Can be confusing in notification emails.
That's not something I would change... The subject should be in the language of the sender...it must be.
BTW, the "no subject" is just an annoyance IMHO.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Robert.

I can confirm this, I've tested this on Yoshi's site (thanks Yoshi ;)) and the footer was in English rather than Spanish. ;)

agridoc

Thank you for taking care of it  emanuele.

Quote from: emanuele on April 15, 2012, 06:21:42 AM
Quote from: agridoc on April 15, 2012, 01:30:12 AM
- In PM, if no subject exists, the no subject string $txt['no_subject'] is used from sender's language not recipient's as it should. Can be confusing in notification emails.
That's not something I would change... The subject should be in the language of the sender...it must be.
BTW, the "no subject" is just an annoyance IMHO.

You are partially right. The subject should be in the language of the sender, IF EXISTENT. it's a direct string, an input by the sender.

However, IF EMPTY, the parameter $txt['no_subject'] from the recipient's language should be used to be understandable. Not so important as $txt['new_pm_subject'] in front of it is taken from recipient's language.

I agree that it might need some queries, that should be considered. I also agree that, as $txt['new_pm_subject'] exists in email subject, the notification email subject will ontain something understandable.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

emanuele

Quote from: agridoc on April 15, 2012, 07:12:20 AM
Quote from: emanuele on April 15, 2012, 06:21:42 AM
Quote from: agridoc on April 15, 2012, 01:30:12 AM
- In PM, if no subject exists, the no subject string $txt['no_subject'] is used from sender's language not recipient's as it should. Can be confusing in notification emails.
That's not something I would change... The subject should be in the language of the sender...it must be.
BTW, the "no subject" is just an annoyance IMHO.

You are partially right. The subject should be in the language of the sender, IF EXISTENT. it's a direct string, an input by the sender.

However, IF EMPTY, the parameter $txt['no_subject'] from the recipient's language should be used to be understandable. Not so important as $txt['new_pm_subject'] in front of it is taken from recipient's language.

If you leave the subject field empty you receive a warning: "No subject was filled in.", so the trick is that as long as there is any thing in the field "subject", the subject exits. Even if it is "no subject".
This is not something checked after the PM is sent, it's something that is outputted on the user's window, so the user that is sending the PM has full control over the field and leaving "ho subject" he simply states that he is fine with that.

That's why I say it should not be changed...well I would remove it completely, but that's "just" me. :P


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

agridoc

I was afraid the the way SUBJECT is defined should need quite some reworking to work ideally also in PM notification emails.

That's accepted, a compromise between ideal and code.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

emanuele

Okay, now (after looking at the code) I'm a bit confused... :P

agridoc, would you mind try this change and see if it fixes the issue?

In Post.php
Code (find) Select
$langloaded = loadLanguage('EmailTemplates', empty($rowmember['lngfile']) || empty($modSettings['userLanguage']) ? $language : $rowmember['lngfile'], false);
Code (replace with) Select
$langloaded = loadLanguage('index', empty($rowmember['lngfile']) || empty($modSettings['userLanguage']) ? $language : $rowmember['lngfile'], false);

Code (find) Select
// Sent!
$smcFunc['db_query']('', '


Code (add before) Select
loadLanguage('index', $user_info['language']);

Idea behind: the EmailTemplate is already loaded in loadEmailTemplate, while $txt['regards_team'] is in index or in Post (and in the development version ago I removed it from Post a while because I considered it a duplicate...but now I'm wondering if I broke something else... ::) ...oh let's see, beta are for testing! :P), so...this line should take care of reloading other strings not present in EmailTemplate (i.e. regards_team).

And of course the second bit is to reload the user's language at the end...

Let me know! ;D


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

agridoc

Well done emanuele   ;)

Team regards in recipient's language, no errors in log.
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

emanuele

Good!

I'm going to apply to the devel version, thanks for testing.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

agridoc

Keep also the PM subject issue somewhere in your mind. Maybe someday, when you are in the mood, the right flash ...
  For Greek aeromodellers and our friends around the world  - Greek Button sets for SMF - Greeklish to Greek mod
Δeν αφιερώνω χρόνο για μηνύματα σε greeklish.

Advertisement: