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
herrvigg opened this issue Jun 22, 2018 · 8 comments
Closed
Labels
legacy issue Legacy issue imported from original repo need info The submitter must provide more info

Comments

@herrvigg
Copy link
Collaborator

Issue by HowToSolutions
Saturday Sep 12, 2015 at 10:43 GMT
Originally opened as qTranslate-Team/qtranslate-x#259


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.

@herrvigg herrvigg added legacy issue Legacy issue imported from original repo need info The submitter must provide more info labels Jun 22, 2018
@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Saturday Sep 12, 2015 at 17:57 GMT


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?

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Saturday Sep 12, 2015 at 18:22 GMT


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.

@herrvigg
Copy link
Collaborator Author

Comment by HowToSolutions
Saturday Sep 12, 2015 at 18:56 GMT


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 .

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Saturday Sep 12, 2015 at 20:11 GMT


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

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Saturday Sep 12, 2015 at 20:48 GMT


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.

@herrvigg
Copy link
Collaborator Author

Comment by HowToSolutions
Sunday Sep 13, 2015 at 09:56 GMT


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.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Sunday Sep 13, 2015 at 14:52 GMT


Thanks!

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Friday Oct 09, 2015 at 05:59 GMT


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
legacy issue Legacy issue imported from original repo need info The submitter must provide more info
Projects
None yet
Development

No branches or pull requests

1 participant