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

Comments

Projects
None yet
2 participants
@HowToSolutions
Copy link
Contributor

HowToSolutions commented Sep 12, 2015

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 johnclause added the question label Sep 12, 2015

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 12, 2015

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

This comment has been minimized.

Copy link
Member

johnclause commented Sep 12, 2015

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

This comment has been minimized.

Copy link
Contributor Author

HowToSolutions commented Sep 12, 2015

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

This comment has been minimized.

Copy link
Member

johnclause commented Sep 12, 2015

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

@johnclause johnclause closed this Sep 12, 2015

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 12, 2015

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

This comment has been minimized.

Copy link
Contributor Author

HowToSolutions commented Sep 13, 2015

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

This comment has been minimized.

Copy link
Member

johnclause commented Sep 13, 2015

Thanks!

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 9, 2015

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.