Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
pisaldi Posted May 3, 2015 Posted May 3, 2015 When you create a language you can enable the language option for your community...In the bottom side of your community there appears the language option, and when you click on it, with the language name there appears a flag with it...How must I do to change the flag that it appears and show another one?For example, by default English comes with USA flag, how can I change this flag? Thanks
Meddysong Posted May 3, 2015 Posted May 3, 2015 It's the locale not the language which determines the flag. If you want, say, the British flag to be used when you use English, change the locale for English to en_GB.UTF-8. Or do you need a new flag entirely? I had to add my own but there's a sprite with many flags on built into the suite. If you can see it in this image, then I can tell you how to get it to load. And if you need a new one entirely, I can help with that too.
pisaldi Posted May 3, 2015 Author Posted May 3, 2015 It's the locale not the language which determines the flag. If you want, say, the British flag to be used when you use English, change the locale for English to en_GB.UTF-8.Or do you need a new flag entirely? I had to add my own but there's a sprite with many flags on built into the suite. If you can see it in this image, then I can tell you how to get it to load. And if you need a new one entirely, I can help with that too.Thank you very much for the long list of flags...The problem I have is for a different language... it is for the language spoken in Barcelona for more that 6 million people which is called Catalan, but the locale to use is spanish, and then for catalan it appears the flag of Spain which is incorrect...The locale for catalan is "catala (Espanya)" which takes spanish... and doesn't show catalonian flag... and it is needed to change flag... is that possible if the flag doesn't appear in locale? if you can explain how to insert a new flag would be perfect! if that's not possible, how can I do to make not appear the flags?
Meddysong Posted May 4, 2015 Posted May 4, 2015 The problem I have is for a different language... it is for the language spoken in Barcelona for more that 6 million people which is called Catalan, Vaig començar a aprendre el català - m'agreda molt I've just returned home from the airport, but when I get some free time tomorrow, I'll explain how to do it.
pisaldi Posted May 4, 2015 Author Posted May 4, 2015 If you need help understanding some paragraphs or phrases, just tell me!
Meddysong Posted May 5, 2015 Posted May 5, 2015 OK, Jordi, here we go. What currently happens is that every installation of IPS 4 has that same graphic that I posted above. There is specific CSS for each country code which determines what part of the image to show. You need to do the same as I did, which is add your own flag to the image, and then use CSS to load the correct part of it. Currently the CSS for Catalunya is loading the Spanish flag because of .ipsFlag.ipsFlag-ca{background-position:0 -896px;} in flags.css. That's the position of the Spanish flag on the image. So what we're going to do is change the image to include the flag of Catalunya, and then change the CSS to load that part. Download this image that I've attached. I've added the flag of Catalunya to it; it's the second one. Add it somewhere on your site. I chose uploads/set_images_1/ for mine. Then go to custom.css and add: .ipsFlag { background: url('path/to/flags16.png'); } .ipsFlag-ca { background-position:0 -32px; The first bit tells it to use that image rather than the one already in your suite. The second bit tells it that if the locale is ca, it should load that particular bit of your image, which is where I've put the flag in it. That's how I did it on mine and it's working perfectly, so I hope the advice works for you too.
pisaldi Posted May 5, 2015 Author Posted May 5, 2015 Thanks for your explanation...Could you please resend the image? I can't see it correctly...
Meddysong Posted May 6, 2015 Posted May 6, 2015 It's there but the forum software has resized it. Click on it so that you get the black box, then click on "Full Size" to open it in another tab. It will still be very small because the browser fits it to the window, but you can click in it again to see it in full size. Then right-click and save it. Or, even easier, click this link and then save it http://community.invisionpower.com/uploads/monthly_2015_05/flags16.png.491a0c502bbb97a51418f68c67372f50.png
pisaldi Posted May 6, 2015 Author Posted May 6, 2015 Hi, I'm sorry, but I'm missing something...I copied the code inserting the URL to the flags (which I checked and works) and now all flags for the 3 languages have dissapeared, so I'm doing something incorrectly...ipsFlag { background: url('http://slotadictos.es/flags16.png'); } .ipsFlag-ca { background-position:0 -32px; }I also tried with .ipsFlag-ca-ES and didn't work...Any tip, please?
Meddysong Posted May 6, 2015 Posted May 6, 2015 I can see all three flags on your site, but the Catalan locale is calling .ipsFlag-ES, so that has the Spanish flag. What does your locale look like? Is it something like ca_ES? If it is, then that's the problem.Hmm. I'm not sure how you could solve that one because it's the letters after _ which determine which flag is called. For example, if the locale is xx_YY then .ipsFlagYY is used.One solution would be to put an image of the Catalan flag over the Spanish one, but that won't work if you need to use the Spanish locale too.What other choices do you have for locale? Is ca_FR a possibility? Do you have a VPS, where you could copy the locale ca_ES and call it ca_CA?If it's easier, you can send me a message with your admin details and I could look for myself.
pisaldi Posted May 6, 2015 Author Posted May 6, 2015 The problem is that the ONLY possible locale for catalan is ca_ES...The locale I think it is to know which characters can be used with the language, isn't it?Then the solution would be to take the position of a flag which al uses spanish, any of the south american countries which will not use when using catalan and select for catalan that variance of spanish... Would it be possible?I use a shared hosting... Thanks for your help!
Meddysong Posted May 6, 2015 Posted May 6, 2015 Yes, that would be a solution but it brings with it another problem. If you do that, then you end up using that variation of Spanish in the locale. That will cause you problems because instead of diumenge etc you'll have the Spanish names. So you'll have the Catalan flag and your own translations, but some of the details which you can't control (days of the week, months etc) because they are determined from the locale will be in the wrong language. I'm in a position like that myself. My locale doesn't exist and I can't add it, so although my flag is translated and my language strings are, I've got some English words: Why don't we experiment, a bit? If the system needs to see _ca to load .ipsFlag-CA, why don't we give it that? In Customization > Languages click on the pencil for Catalan. Where it says locale, instead of choosing Catalan, select -my locale isn't listed-. This produces another box Locale Code, into which you could type ca_CA or ca_CA.UTF-8. Try both of those. The system won't be able to find ca_CA so might try the first alternative, say ca_ES. If that's the case, then you might find it loading the text from the locale ca_ES but looking at the flag .ipsFlag-CA. Mine is something like this, where it looks up the correct flag but uses English as the locale because it can't find eo_XX.
pisaldi Posted May 6, 2015 Author Posted May 6, 2015 The problem is that the hosting only allows real locale, so I can't try choosing non existant locales... The best option will be to refuse flags... What it can't never be shown is catalan language with spanish flag for potilical reasons... so it's better don't use flags... I will use ipsFlag { background: url('http://slotadictos.es/flags16.png'); } adressing to a non existant URL so it will not find any flag... Thanks for your huge help!!!
Meddysong Posted May 6, 2015 Posted May 6, 2015 Ah, man ... I'm sorry I couldn't help you any more. I share the frustrations of not having my own particular locale on the system either. I'm only sorry that we couldn't work out a solution for you too.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.