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

RFC: "flat" flags without bevel effect #52

Open
mweimerskirch opened this issue Feb 26, 2015 · 20 comments
Open

RFC: "flat" flags without bevel effect #52

mweimerskirch opened this issue Feb 26, 2015 · 20 comments

Comments

@mweimerskirch
Copy link
Contributor

The flag icons currently have a slight bevel effect. This limits the way they can be used, because the bevel effect does not always fit. If they were flat, they could be used in a more wide range of sites without having to manually find other icons. For backwards compatibility, the bevel effect can be re-added using a line of CSS (2 simple inset box-shadows)
At the same time, the resolution of the flag icons could be increased so they can be used in larger versions.

@johnclause
Copy link
Member

Was it so with all former qTranslate flags, or is it new feature of "qTranslate-X"?

@mweimerskirch
Copy link
Contributor Author

It's been the same pixelated flags since I started using qtranslate several years ago. That's why I think it's time to update them to cleaner versions (higher resolution and no bevel effect). The slight bevel effect in CSS could be added so the layout of older sites wouldn't break, but because it's CSS it could be easily hidden.

@johnclause
Copy link
Member

I do not mind any improvement, I am just totally swamped right now to deal with this. It is not a high priority, but some day yes, we should do this.

@pedro-mendonca
Copy link
Contributor

Just found this, might be useful :)
https://github.com/lipis/flag-icon-css

@pedro-mendonca
Copy link
Contributor

@johnclause I've looking in your code but I cannot find where the xx.png flag file is defined. I've deleted the list in qtranslate.php where you have "gb.png" assigned to "en" language, but it still go and pick that file name.
Where is it defined?

@johnclause
Copy link
Member

The current configuration is stored in database, which originally gets populated from the list in qtranslate.php or user manual input. There is an imperfection here, newly added languages are not shown up until one rest configuration or start new fresh database. This is something to improve too, but not a high priority, since people do not normally care about new languages added and nobody actually complained about it yet. What are you looking for?

@pedro-mendonca
Copy link
Contributor

I was studying the possibility to include https://github.com/lipis/flag-icon-css as a submodule library, for now just for fun, but in case of success maybe suggest it in the future.

@johnclause
Copy link
Member

👍

@pedro-mendonca
Copy link
Contributor

I thought it might be in the database, as the flag list just updated when I reset the plugin a few days ago when some new languages where added.

@pedro-mendonca
Copy link
Contributor

@johnclause I've completed the experience to use the library https://github.com/lipis/flag-icon-css as submodule.
You can test it here, I've completely synced it with your last commit 12e5612
Link to test: https://github.com/pedro-mendonca/qtranslate-x/tree/test-flags
If it's easier to compare I can make a pull request just for you to check full diffs.
I tried to describe every single piece of modification and added //TESTING flag-icon-css in the code.
I didn't modified anything in the widget, It also have a flag option, but I didn't have the time yet. I'll do it later if would like to integrate this submodule to have these brand new flags. As I'm not a developer neither an expert in php, I've searched and successefully re-added the css calls, but you should check if this is ok. Still, aparently it's working allright now :)

Things to consider:

  1. The license, they just ask whoever uses it to keep the license, it's in the path.
  2. Loading times, as some flags are heavier as they're detailed vector files. From my experience it's ok, but I should be considered.

Todo:

  1. Check out Alt Text options, verify where it still can substitute old flags, like widget, ultimately delete old flags
  2. Delete unnecessary files in the submodule.

@johnclause
Copy link
Member

This sounds great, Pedro 👍 Things like this should go with an option, so that people can choose which way to display flags, and old way should be the default, so that on currently live installations nothing changes, unless admins change it manually. Flag information retrieval will need to be encapsulated in a separate function, which will test the new option and act accordingly.

Current flags have 3:2 aspect ratio, so we will not be able to simply substitute new flags, CSS will need to be adjusted too, and people, who customized CSS, will need to do manual work. Is there a way to get 3x2 version simply enough too? Probably not ...

BTW, could you suggest them to update on missing flags?

I am currently busy with a few other things. Pedro, will it be too much to ask you to complete it all with options, encapsulation etc in a clean way?

@pedro-mendonca
Copy link
Contributor

pedro-mendonca commented Mar 6, 2015 via email

@johnclause
Copy link
Member

We can continue under different issue, before this one gets too long to scroll.

I believe, those zones in Spain are recognized in the World with different locale "eu_ES" and "gl_ES", as they are listed in the output of command "locale -a". So, asking to add those flags is not something extraordinary special.

As to a guidance, it is actually a lot to do, may be even more than you have done so far ;) You may search for all occurrences of any option, like 'flag_location', for example, and follow the pattern. But before that you need to design what exactly options to add. Option "Flag Image Path" may probably stay as is? Other options may be "Flag Format" ("png", "svn"), "Flag Aspect Ratio", "Flag Size", for example? There is new option "Remove plugin CSS" which was migrated from mq, and which basically removes common part of flags CSS, but it might be better to have option "Flags CSS" instead. You may prepare your design of options with their descriptions in the new issue as the first step, and we can go from there?

@Grafcom
Copy link

Grafcom commented Mar 6, 2015

I was working for myself on a new set of flags and I saw that you were also working/thinking about it.
I have almost all flags in vector format, I can convert it to any format and almost any size and resolution.
If I can help let me know.
Best

@pedro-mendonca
Copy link
Contributor

@johnclause I'll check on other options code and pattern and design the options necessary for this.
About the flag options, would you like to keep this flag-icon-css submodule or @Grafcom new flags? Are these new flags dedicated to this plugin or also as a reusable package to be included as submodule?
I'll start a new dedicated issue on this as soon as I can.

@Grafcom
Copy link

Grafcom commented Mar 9, 2015

@pedro-mendonca,
new flags, in the format/resolution in which you want them - I make them specially for qTranslate x - but the original vector files are free to use.

@johnclause
Copy link
Member

I think the best, would be, if we want to be really fancy, is to let user to decide, which resolution and ratio they want and then auto-generate .png files for the parameters chosen out of .svn files for languages in use only. So we can keep .svn files in subfolder flags/svn, png original files in subfolder flags/png and folder 'flags' will only have flags needed and either generated or copied. Is that possible to do?

@LC43
Copy link

LC43 commented Apr 20, 2015

ohh, this issue is nice! having 255 .png files for each qtranslate install where we would use normally just 2 or 3 always bothered me... specially when they could be turned into a sprite. extra points for requesting one file instead of 2 or 3 or .. !

how about using them in .svg format, like the flags @pedro-mendonca mentioned?
http://caniuse.com/#feat=svg

@pedro-mendonca
Copy link
Contributor

@LC43 I've made a first aproach to this in #71.
The problem is the same with this submodule, a lot of files. As @johnclause mentioned this should be optional as this image ratio could break some current sites css, I didn't have the time to make it yet, feel free to improve this if you want :)
A good thing also mentioned above would be the download of the flag when a new language is added.

@benique
Copy link
Contributor

benique commented Sep 25, 2015

I've thought about svg flags as well. I think png flags would be a good alternative to the sag flags because they can be much more compressed. So we could save bandwidth. Since we usually only use pretty small flags the png files would take up a lot less space.

I think we could implement the translations (texts & flags) in a different way. So that they can be downloaded on demand. That would make the plugin slimmer and it would be very easy update the translations without the need to update the plugin.

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

No branches or pull requests

6 participants