Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

fatal_lang_error question

Aloittaja The Wizard, maaliskuu 02, 2014, 10:35:23 AP

« edellinen - seuraava »

The Wizard

Hello:

Is there any way to use the "fatal_lang_error" but direct it to read text from my "ToyShop.english.php" file instead of the "Modifications.english.php" file?
The reason I ask is that if someone wanted to translate my work into another language it would be easier, and quicker to just have to translate the ToyShop.english.php file.

If so could you show me a example of how this can be done?

Thanks

Wiz

emanuele

loadLanguage('ToyShop');
fatal_lang_error('whatever_string_you_want_to_use');


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.

The Wizard

Hi emanuele:

I tried that, and it does not work. As I understand it the "fatal_lang_error" has it's own template it uses, and uses the "Modifications.english.php" file to call the language. I was just hoping there was a way to use my own language file, but I don't think so. I Would like to hear what some of the guys working on the code functions of smf have to say about this?

Wiz

margarett

It should use primarily Errors.english.php, actually.
But, as long as the language is loaded, the string should be recognized from whatever file it comes as emanuele says. It should, I will test it when I get to the PC.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

emanuele

fatal_lang_error uses the argument you pass as index of $txt:
https://github.com/SimpleMachines/SMF2.1/blob/master/Sources/Errors.php#L167

So, you can place your string any where you want, provided you load the language file before calling fatal_lang_error and is stored into the usual $txt variable.

Lainaus käyttäjältä: The Wizard - maaliskuu 02, 2014, 12:10:06 IP
I Would like to hear what some of the guys working on the code functions of smf have to say about this?
I may not have a shiny badge, but I think I know something of how SMF works. ;)


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.

margarett

Actually you do. It's not shiny (dark brown isn't) but there's one there ;)
And by all means yes, you know how stuff works!
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: