MyBB Community Forums

Full Version: What are lang files? What is there purpose?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Apart from telling the forum what language it is, What do they actually do?
No they don't tell it what language it's in, they store language strings. It's so MyBB can be translated. There's stuff like this in the code and template:

$lang->welcome_login

In the english pack that will output "Login". In a French language pack it'd say Login in French.
I looked around a messages lang file, And it has "Variables" like "[[[[[ $l['error_message_too_short'] = "Sorry, your message is too short and cannot be posted."; ]]]]]" - If im correct, Basically if somewhere in all the PHP files and codes, There is a command to display $l['error_message_too_short'], It would display Sorry, your message is too short and cannot be posted. ?
Yes. It's be $lang->error_message_too_short to show that, once that language file has been loaded.
So by change one "text" item in a lang file, Like an error message, It will be the same for whatever php pages use that variable?
Yeah. Make sure that you don't use notepad when editing it though, use wordpad or another editor, notepad adds hidden characters that will break it.
Does NVU (HTML editor) and cPanel's own Code Editor add secret stuff?
Shouldn't do, I've use the cPanel one in the past. Notepad is the only one I know that regularly does it.
But if its invisible, How can you tell?
Matt has superpowers, but don't tell anyone, it's a secret. Wink
Pages: 1 2 3