Advertisement:

Author Topic: [SOLVED] Publish A Listing Multilanguage like in Modern Theme (OsclassWizards)  (Read 2083 times)

Igirus

  • Newbie
  • *
  • Posts: 20
Can anyone help, how to add Multilanguage choising in item_add.php like Modern Theme
« Last Edit: February 01, 2016, 05:47:20 pm by Igirus »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Publish A Listing Multilanguage like in Modern Theme (OsclassWizards)
« Reply #1 on: January 26, 2016, 01:38:30 pm »
***CORRECTED***

Hi,

This is how you get Multilanguage title/description like Modern:

1.- Uncompress the attached zip into your theme folder.

2.- Your theme item-post.php:

2a.- Replace this line:

Code: [Select]
    osc_enqueue_script('jquery-validate');
with:

Code: [Select]
    osc_enqueue_script('jquery-validate');
    osc_enqueue_script('tabber');
    osc_enqueue_style('tabs', osc_current_web_theme_url('css/tabs.css'));

2b.- You need to replace the code that prints separated Title/description elements. For Osclasswizards:

Carefully delimite and replace:
Code: [Select]
          <div class="form-group">
            <label class="control-label" for="title[<?php echo osc_current_user_locale(); ?>]">
              <?php _e('Title'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </label>
            <div class="controls">
              <?php ItemForm::title_input('title',osc_current_user_locale(), osc_esc_htmlosclasswizards_item_title() )); ?>
            </div>
          </div>
          <div class="form-group">
            <label class="control-label" for="description[<?php echo osc_current_user_locale(); ?>]">
              <?php _e('Description'OSCLASSWIZARDS_THEME_FOLDER); ?>
            </label>
            <div class="controls">
              <?php ItemForm::description_textarea('description',osc_current_user_locale(), osc_esc_htmlosclasswizards_item_description() )); ?>
            </div>
          </div>

With:

Code: [Select]
            <div class="controls">
                <?php ItemForm::multilanguage_title_description(); ?>
            </div>

Then maybe you'd want to make some changes in tabs.css to adapt it to your theme looks.

Regards
« Last Edit: February 01, 2016, 08:20:49 pm by teseo »

Igirus

  • Newbie
  • *
  • Posts: 20
Re: Publish A Listing Multilanguage like in Modern Theme (OsclassWizards)
« Reply #2 on: January 31, 2016, 07:34:33 pm »
teseo thx a lot, its working perfectly.
Do you know how to make in same text_input window that can change by clicking the language. Im wery weak in JS.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Publish A Listing Multilanguage like in Modern Theme (OsclassWizards)
« Reply #3 on: February 01, 2016, 04:02:25 pm »
teseo thx a lot, its working perfectly.

You're welcome. :) Please add [SOLVED] to the title of this thread.

Quote
Do you know how to make in same text_input window that can change by clicking the language. Im wery weak in JS.

Sorry, that sounds too complicated.  :-\

Regards

Igirus

  • Newbie
  • *
  • Posts: 20
This code is working but without JavaScript. More beautifully will be if javascript could change text area for different languages like in Modern Theme.
Or another solution make in same text area for both languages, but need make it searchable for both languages, other way search results will be 0 on another language.
Teseo can you help? or some body else?
 
« Last Edit: February 01, 2016, 06:54:18 pm by Igirus »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Sorry, I don't understand you. ??? What difference exactly do you see between Modern behaviour and this adaptation? ???

Igirus

  • Newbie
  • *
  • Posts: 20
Now i changed my last post that can easily to understand what i mean  :)

teseo

  • Hero Member
  • *****
  • Posts: 6169
Now I understand what's happening. Sorry, there was an error on my code, CSS stylesheet wasn't being loaded.

The correct code at the start of item-post.php is:

Quote
    osc_enqueue_script('jquery-validate');
    osc_enqueue_script('tabber');
    osc_enqueue_style('tabs', osc_current_web_theme_url('css/tabs.css'));

Quote
need make it searchable for both languages

That's a common problem with multilanguage installations, see here for a solution:

http://forums.osclass.org/3-5-x/search-problem-oc-3-5-3/msg113711/#msg113711

(4th version)

Regards

Igirus

  • Newbie
  • *
  • Posts: 20
Thank you. Now CSS is working. And i also tested your fix (4th version) for multilanguage search and it's working also!
Is it possible to change that default language (website) will be activated first in tab? not english


Igirus

  • Newbie
  • *
  • Posts: 20
Thx!
ok, now that completely close this topic  :) need make "Title" and "Description" translatable. Because now our Title and Description in tabber js, how can translate it?  :o

teseo

  • Hero Member
  • *****
  • Posts: 6169
I'm afraid that would require too much work and core modifications. Anyway the page language is that what the user has selected, so I see no problem with that.

Regards