Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In qtranxf_generateLanguageSelectCode add another option to $type argument #259

Closed
HowToSolutions opened this issue Sep 12, 2015 · 8 comments
Labels

Comments

@HowToSolutions
Copy link
Contributor

I'm using direct call to qtranxf_generateLanguageSelectCode($type,$id) in my template but since my flags are rendered using CSS, I really don't need anything rendered. Unfortunately, there are only
'image', 'text', 'both' and 'dropdown' available for $type argument.

At the moment I solved this by using 'image' option and then hiding those images with CSS, but it would really be great, if there would be some sort of 'none' option.

@johnclause
Copy link
Member

If you do not call qtranxf_generateLanguageSelectCode at all, wouldn't it be the same as 'none' option?

I guess, better name might be 'css_only' instead of 'none', no image no text, but list of items with css classes? Anyway, would you mind to submit a pull request with the case you wish?

@johnclause
Copy link
Member

BTW, I never researched, but was always curious, why the original author used java script to generate 'select' item for 'dropdown' option? Do you see why?

BTW, set of arguments for this function never made sense to me ... it probably needs to be re-designed.

@HowToSolutions
Copy link
Contributor Author

I apologize, I should have been more precise.

I call qtranxf_generateLanguageSelectCode, so that the HTML code for Language selection is rendered, I just don't need anything inside it, since I use CSS to render appropriate flags.

I submited the pull request #260 .

@johnclause
Copy link
Member

Thank you, that was quick. Will be released in 3.4.5.

@johnclause
Copy link
Member

I updated the widget code with 'css_only' option too, the latest https://github.com/qTranslate-Team/qtranslate-x has it all. I would appreciate if you could test it all.

@HowToSolutions
Copy link
Contributor Author

I tested it and it seems fine. For all the types except 'css_only' I compared the generated HTML code of the latest version with the version currently on WordPress and the generated HTML code is the same.

Looking at the generated code, I did notice something about the 'dropdown' type. It uses onchange event, so it needs JavaScript to function. In cases, when JavaScript is disabled, the 'dropdown' option will simply not be created as it uses JavaScript for rendering and then it falls back to text type.

@johnclause
Copy link
Member

Thanks!

@johnclause
Copy link
Member

Please, follow #208, as option 'css_only' has been removed, but you can achieve, what you need with option 'custom' and empty 'format'. Please, continue discussion at #208, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants