slug translation implemented, needs review

Any suggestions on how to improve qTranslate? Post here!

oh its great

Postby Agrafagr » Tue May 29, 2012 10:37 am

Sorry, what you mean?
Agrafagr
 
Posts: 2
Joined: Sat Mar 17, 2012 12:38 am
Location: Argentina

Re: slug translation implemented, needs review

Postby CarlosSanz » Sun Jun 03, 2012 1:35 am

I mean there is a version 0.9 ( adaptation of original Qtranslate Slug plugin writed by Cimatti ). This version adds support to categories, tags, taxonomies and custom post types.
And i will upload to 1.0 soon, completely rewritted, better coded, commented and with some enhancements on it.

greetings.
CarlosSanz
 
Posts: 8
Joined: Tue Feb 22, 2011 1:23 am

Re: slug translation implemented, needs review

Postby CarlosSanz » Sun Jun 17, 2012 5:23 pm

Qtranslate Slug version 1.0 uploaded, compatible with 3.4

Greetings!
C.
CarlosSanz
 
Posts: 8
Joined: Tue Feb 22, 2011 1:23 am

Re: slug translation implemented, needs review

Postby CarlosSanz » Sat Jun 23, 2012 6:22 pm

Qtranslate Slug version 1.1 uploaded. Some bugfixes and multisite support.

Enjoy!
C.
CarlosSanz
 
Posts: 8
Joined: Tue Feb 22, 2011 1:23 am

Re: slug translation implemented, needs review

Postby janfoo » Tue Jun 26, 2012 2:12 pm

Carlos, does your plugin have an equivalent to qTranslateSlug_getSelfUrl($lang), i.e. a function I can call from funtions.php to implement a language switcher?
janfoo
 
Posts: 1
Joined: Tue Jun 26, 2012 2:10 pm

Re: slug translation implemented, needs review

Postby CarlosSanz » Sun Jul 01, 2012 5:11 pm

If you want to print a language switcher menu, call this function:

Code: Select all
if (function_exists('qts_language_menu') ) qts_language_menu('dropdown');


Arguments of this function are:

Code: Select all
qts_language_menu($type, $args);
$type = 'text', 'image', 'dropdown', 'both'
$args = array(
    'id' => 'qts-lang-menu', // ID of html oputput
    'class' => 'qts-lang-menu',  // class / classes of the html output
    'short' => false // if true, display text as short 'English' -> 'en'
)


If you want to know the current url in other language, you can do:

Code: Select all
global $qtranslate_slug;
$qtranslate_slug->get_current_url('en');
CarlosSanz
 
Posts: 8
Joined: Tue Feb 22, 2011 1:23 am

Re: slug translation implemented, needs review

Postby gfaw » Sat Sep 29, 2012 6:48 pm

CarlosSanz wrote:If you want to print a language switcher menu, call this function:

Code: Select all
if (function_exists('qts_language_menu') ) qts_language_menu('dropdown');


Arguments of this function are:

Code: Select all
qts_language_menu($type, $args);
$type = 'text', 'image', 'dropdown', 'both'
$args = array(
    'id' => 'qts-lang-menu', // ID of html oputput
    'class' => 'qts-lang-menu',  // class / classes of the html output
    'short' => false // if true, display text as short 'English' -> 'en'
)


If you want to know the current url in other language, you can do:

Code: Select all
global $qtranslate_slug;
$qtranslate_slug->get_current_url('en');



Could you be a bit more specific please?

The Plugin works well, but my lanugage selector doesn't work with it. I don't use a wigdet but have put this code:

Code: Select all
<?php echo qtrans_generateLanguageSelectCode('text'); ?>

in my header.php. I modified it with an entry in the theme's functions.php to shorten the text to DE and EN, should this be of any interest.

I dont have a clue where and how I should get my hands on.

Does anybody have an idea?
gfaw
 
Posts: 14
Joined: Fri Aug 28, 2009 8:08 am

Re: slug translation implemented, needs review

Postby baga » Mon Oct 01, 2012 1:37 pm

gfaw wrote:
The Plugin works well, but my lanugage selector doesn't work with it. I don't use a wigdet but have put this code:

Code: Select all
<?php echo qtrans_generateLanguageSelectCode('text'); ?>


I dont have a clue where and how I should get my hands on.

Does anybody have an idea?


Use this code instead:

Code: Select all
<?php if (function_exists('qts_language_menu') ) qts_language_menu('text'); ?>
baga
 
Posts: 14
Joined: Sat Apr 03, 2010 1:07 pm

Re: slug translation implemented, needs review

Postby gfaw » Tue Oct 02, 2012 5:37 pm

baga wrote:
gfaw wrote:
The Plugin works well, but my lanugage selector doesn't work with it. I don't use a wigdet but have put this code:

Code: Select all
<?php echo qtrans_generateLanguageSelectCode('text'); ?>


I dont have a clue where and how I should get my hands on.

Does anybody have an idea?


Use this code instead:

Code: Select all
<?php if (function_exists('qts_language_menu') ) qts_language_menu('text'); ?>


Sorry, but this doesn't work for me. I tried it before - it destroys the layout of the page and also requires new formatting in css.
gfaw
 
Posts: 14
Joined: Fri Aug 28, 2009 8:08 am

Re: slug translation implemented, needs review

Postby gfaw » Tue Oct 02, 2012 9:09 pm

gfaw wrote:
baga wrote:
gfaw wrote:
The Plugin works well, but my lanugage selector doesn't work with it. I don't use a wigdet but have put this code:

Code: Select all
<?php echo qtrans_generateLanguageSelectCode('text'); ?>


I dont have a clue where and how I should get my hands on.

Does anybody have an idea?


Use this code instead:

Code: Select all
<?php if (function_exists('qts_language_menu') ) qts_language_menu('text'); ?>


Sorry, but this doesn't work for me. I tried it before - it destroys the layout of the page and also requires new formatting in css.



UPDATE:

It works! This is what I did:

    - updated WP to most recent version
    - updated qtranslate to most recent version
    - cleared all slug fields (3in my case 2 languages & 1 slug field a little lower down), then saved it. Basically this forces the regeneration of the slug from the title and it's translation. Before I didn't do this, switching the language with the language selector gave me 404s, while if I stayed within a language it usually was ok. Perhaps when setting up a new wp-installation with the final permalinkstructure from the very start this won't occur. I couldn't do it as when I started building the site my webspace package didn't support .htaccess so I couldn't use real pretty permalinks. I tried PATHINFO, but had the same trouble. Then I upgraded the webspace so now I have full .htaccess functionality, although the problem with using PATHINFO perhaps goes back to the same rootcause. Perhaps non of this was necessary either.
gfaw
 
Posts: 14
Joined: Fri Aug 28, 2009 8:08 am

PreviousNext

Return to qTranslate Suggestions Forum

Who is online

Users browsing this forum: No registered users and 2 guests