Author Topic: [MOD] Multi-Language support for any text (updated 05-11-2005)  (Read 215950 times)

0 Members and 1 Guest are viewing this topic.

Offline egyptandy

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #150 on: May 11, 2009, 09:25:14 PM »
Sorry for this. but those have been obviously mistakes in the template.
My website pops now up again, but without the expected multilang effects.
I see on the web site always such Catagory names [deutsch]Test  [english]Trial   whether I use the english or deutsch Tab.

But before the site did pop up again I had to delete the multilang code 2x in:
$site_template->register_vars(array(
"cat_name" => format_text($image_row['cat_name'], 2),

and also in

$num_subs = sizeof($visible_cat_cache);
  $sub_cat_list = "";
  $i = 1;
  foreach ($visible_cat_cache as $subcat_id) {
    if ($i <= $num_subs && $i <= $config['num_subcats']) {
      $sub_url = $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$subcat_id);
      $sub_cat_list .= "<a href=\"".$sub_url."\" class=\"subcat\">".format_text($cat_cache[$subcat_id]['cat_name'], 2)."</a>";

and finally in

$category_list = "";
  foreach ($drop_down_cat_cache[$cid] as $key => $category_id) {
    if (check_permission("auth_viewcat", $category_id)) {
      $category_list .= "<option value=\"".$category_id."\"";
      if ($cat_id == $category_id) {
        $category_list .= " selected=\"selected\"";
      }
      if ($cat_cache[$category_id]['cat_parent_id'] == 0) {
        $category_list .= " class=\"dropdownmarker\"";
      }

      if ($depth > 1) {
        $category_list .= ">".str_repeat("--", $depth - 1)." ".format_text($cat_cache [$category_id]['cat_name'], 2)."</option>\n";
      }
      else {
        $category_list .= ">".format_text($cat_cache [$category_id]['cat_name'], 2)."</option>\n";

Maybe this is the reason for not functioning correctly, but with the multilang tag in, the site did not open and one error message after the other came up.
So I have now no ideas what else to do. All the other changes are done according your MOD. I did not start to do anything about image names or image descriptions so far, because for me the cat names and cat descriptions are the important items.
     

Offline daymos

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #151 on: July 08, 2009, 05:19:59 PM »
can anyone help me create fields like
--------------------------------
Image name in english  |====|
Image name in russian  |====|

$

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #152 on: July 09, 2009, 03:03:54 AM »
Please explain with more details.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #153 on: July 17, 2009, 03:02:47 PM »
Thanks for this mod. It's good work on 1.7.6  :)

I want a little change for it, but i don't know how to create this:
I have 3 languages russian(default), english and deutsch. When i choose deutsch then, if i haven't tag [deutsch] for this field, i see russian. But i want see text in [english] tag. How to change it(russian must be default language)?
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #154 on: July 17, 2009, 03:59:51 PM »
in your particular case you can try this: in includes/functions.php find
  preg_match("#^(.*)\[".$config['language_list']."\]#iDUs"$text$match);

Insert above:
  if ($config['language_dir'] == "deutsch")
  {
    
$b $config['language_dir'];
    
$config['language_dir'] = "english";
    
$t multilang($text$show_first$remove);
    
$config['language_dir'] = $b;
    return 
$t;
  }
« Last Edit: July 21, 2009, 04:32:29 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #155 on: July 17, 2009, 04:09:04 PM »
It is not work :( . It's look like before: if i choose deutsch, i see russian, and not english
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #156 on: July 17, 2009, 04:40:38 PM »
Please show example of the text with tags you are testing with.


[EDIT]

Try move the new code (from my previous post) above
preg_match("#^(.*)\[".$config['language_list']."\]#iDUs"$text$match);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #157 on: July 21, 2009, 04:24:28 PM »
It is work now  :) . Thank you, V@no
Tatyana.
I use 4images v.1.7.6
You can answer me in English and Russian languages.
Sorry, my English is not very good.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #158 on: August 11, 2009, 04:46:16 PM »
Hello V@no,

I like this mod and I am using it om my gallery.

I have a small issue. I am trying to use this mod also for the additional fields, but it does not work yet.

For example:

I want to show the name of the city. If it dutch it will show PARIJS (Frankrijk) and if it English it will show PARIS (France).

In de functions I added this line:

Code: [Select]
"image_city" => multilang($image_city),
And in the ACP i used this line:

Code: [Select]
[english]PARIS (France)[nederlands]PARIJS (Frankrijk)
Am I missing something?

Any help will be appreciated
Cruxy

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #159 on: August 12, 2009, 01:36:11 AM »
you forgot to mention the result of your attempt. does it displays entire string with [] tags or what?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #160 on: August 12, 2009, 01:40:59 AM »
Thanks V@no for your reply.

Yes, I get the following string:

Code: [Select]
[english]PARIS (France)[nederlands]PARIJS (Frankrijk)
Hi V@no:

I solved it with using this string in the details.php:

Code: [Select]
$image_city = multilang($image_row['image_city']);
Thanks anyway for your support.

Cheers,
Cruxy
« Last Edit: August 12, 2009, 02:56:52 AM by cruxy »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #161 on: August 12, 2009, 05:03:13 AM »
in that case, you might have tag "image_city" registered twice...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #162 on: August 12, 2009, 09:10:32 AM »
I beleive so, but I did not test it yet. I will try it later on and I will let you know.

Offline urmasmuld

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #163 on: March 12, 2010, 12:40:38 PM »
Yes, I tested this MOD in 1.7.3 and it works (at least for image description, that is the part I'm interesting in).
Saddly, I get this:

Code: [Select]
Notice: Undefined index: date_format in global.php on line 139

Notice: Undefined index: language_dir in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1857

Notice: Undefined index: language_dir_default in includes\functions.php on line 1861

Notice: Undefined index: language_list in includes\functions.php on line 1861

Notice: Undefined index: time_format in global.php on line 140

Notice: Undefined index: language_dir in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1857

Notice: Undefined index: language_dir_default in includes\functions.php on line 1861

Notice: Undefined index: language_list in includes\functions.php on line 1861

Warning: Cannot modify header information - headers already sent by (output started at global.php:139) in global.php on line 442

But as I said, it works, and if you configure 4images to not to show notices and warnings, then everything should be fine. However, I would like to know how to get rid of those annoying noticies...

Regards.

I got same notices (except that warning). What to do to get those notices disappear ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #164 on: September 07, 2010, 01:12:19 AM »
Hello,

I have some problems with this mod.

My default language is dutch.

So I am using the folowing title in the image_name:

[dutch]dutch[english]english

When I use the english language i get the folowing image_name: english

but when I use the dutch language, I get the folowing image_name: dutch[english]english


I have tried everything, but without results.

Any help will be apreciated.

Thanks in advance,
Cruxy