Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

start with my language
https://www.tinywebgallery.com/forum/viewtopic.php?f=4&t=1961
Page 1 of 1

Author:  Andra [ 7. May 2009, 20:10 ]
Post subject:  start with my language

hello twg

It seems that TinyWebGallery is very nice. I'm trying it now locally. Now I cannot do one thing - sorry if it is all clear but I somehow missed it - how to open index.php in my language without argument (index.php?twg_lang=lv)? I have language/language_lv.php, I even tried to force $lang_browser = 'lv'; in index.php and tested that $default_language = $lang_browser; was executed. All the same by default the page starts English. Any help?

Andra

Author:  TinyWebGallery [ 7. May 2009, 22:08 ]
Post subject: 

Set

$default_language = 'en';

in the config to your language. TWG tries to detect the prefered language you have set in the browser. If this is not detected the setting above is used.

When you are done with your language please sent the language file to me to include it it the next build.
I can give you a nice flag in your language in the same style as the others as well.

- Michael

Author:  Andra [ 7. May 2009, 22:29 ]
Post subject: 

Oh, this was the first I tried. In config.php. That I described was just more complicated actions to do something.
What I am not sure - maybe I miss some more "_lv" file? In root folder I don't have any lv language specific file; there are three files in folder "language" (language_lv.gif, language_lv.php, language_lv.txt); a file in folder "pictures" (folder_lv.txt). And in those _lv there are latvian texts, I can get them if I choose lv flag, but I cannot get open Latvian by default.
Thanks, but :(

And I did logout TWG Administration. I even clear browser cache.

Author:  TinyWebGallery [ 7. May 2009, 22:33 ]
Post subject: 

what is the default language of your browser ?

if you only like your language remove the other language files.

- Michael

Author:  Andra [ 7. May 2009, 22:37 ]
Post subject: 

Maybe then it would be one language - my own. But I was already very glad that in such an easy way (really nice program!) I would get English version also to be able to choose.

Author:  TinyWebGallery [ 7. May 2009, 22:39 ]
Post subject: 

What is the default language of your browser - seems to be english - therefore english is selected.

- Michael

Author:  Andra [ 7. May 2009, 22:42 ]
Post subject: 

removed files folder.txt, language_en.txt, language_en.php, language_en.gif. Tried to open index.php, received fatal error "...Failed opening required....../language/language_ag.php". Why "_ag"???

Author:  Andra [ 7. May 2009, 22:48 ]
Post subject: 

mmm, yes, that's that I described in my first message - I tried to force $lang_browser, but! I did my experiments one by one, so $default_language in config.php was back to original. Now I believe I could force them both. Sorry for being such nuisance to you! Just in my country it is not very usual thing that computer GUI in every way is localized.

Nooo, it did not help...
Now when removed English files, the error is normal:
"...Failed opening required..../language/language_en.php"

Author:  TinyWebGallery [ 7. May 2009, 22:59 ]
Post subject: 

I again ask you: What is the default language of YOUR browser?

in index.php you will find:
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$lang_browser = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if (file_exists(dirname(__FILE__) . '/language/language_' . $lang_browser . '.php')) {
$default_language = $lang_browser;
}
}

which checks this.

- Michael

Author:  Andra [ 7. May 2009, 23:02 ]
Post subject: 

it is English but I force
$lang_browser = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
$lang_browser = 'lv'; //piespiedīšu būt LV by default

and I checked that if branch executed:
if (file_exists(dirname(__FILE__) . '/language/language_' . $lang_browser . '.php')) {
$default_language = $lang_browser;
error_log("iegaja ifaa");error_log($default_language);error_log(" This is Andra !!! ");
}

Author:  TinyWebGallery [ 7. May 2009, 23:07 ]
Post subject: 

The language is stored in the session once it is set. You might only have to close your browser and retry.

- Michael

Author:  Andra [ 7. May 2009, 23:09 ]
Post subject: 

Yes, thank you, that was it! Restart browser.

Author:  TinyWebGallery [ 7. May 2009, 23:53 ]
Post subject: 

;).

Have fun using TWG.
You can complete the language file if you have some time - only a couple of lines are left ...

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/