Change to flag BBCode

This forum is for discussing the ongoing and future projects and resources of UniLang. Please post your comments, criticism and ideas here. We are always trying to expand on things members find useful, helpful, or fun! This is also the place to report errors in systems and resources on the UniLang site.

Moderator:Forum Administrators

User avatar
Yserenhart
Posts:782
Joined:2009-11-09, 2:56
Country:BEBelgium (België / Belgique)
Change to flag BBCode

Postby Yserenhart » 2017-08-15, 22:25

For site security reasons the way that the flag BBCode works internally has been changed. As a result, most existing usages have broken. The problem comes from the optional descriptive text (which was intended to allow the name of the language to be added for people to see when hovering over the flag) now being considered required when the code is parsed. To fix existing flags, and for future usage there are now two options:

Code: Select all

[flag={TEXT}]{LANGUAGE CODE}[/flag]

If you use this you must include the descriptive text, even just a space, to make it work. The supported characters for the descriptive text are Unicode letter characters, numbers, spaces, commas, dots, minus, plus, hyphen, underscore, and white-spaces.

Code: Select all

[flag]{LANGUAGE CODE}[/flag]

This will display the flag and link to a wikipedia page on click, as the other one does, but has no possibility for descriptive text.
Native: Derbyshire English (en-GB)/New Zealand English (en-NZ) Learning: Vlaams (nl-BE)

User avatar
dEhiN
Posts:6828
Joined:2013-08-18, 2:51
Real Name:David
Gender:male
Location:Toronto
Country:CACanada (Canada)
Contact:

Re: Change to flag BBCode

Postby dEhiN » 2017-08-16, 4:34

It seems though that the complex flag codes don't work anymore, using either method. I've tried both en-ca and en-CA with both using a descriptive text and without, and nothing works.
Native: (en-ca)
Active: (fr)(es)(pt-br)(ta-lk)(mi)(sq)(tl)
Inactive: (de)(ja)(yue)(oj)(id)(hu)(pl)(tr)(hi)(zh)(sv)(ko)(no)(it)(haw)(fy)(nl)(nah)(gl)(ro)(cy)(oc)(an)(sr)(en_old)(got)(sux)(grc)(la)(sgn-us)

User avatar
OldBoring
Language Forum Moderator
Posts:6152
Joined:2012-12-08, 7:19
Real Name:Francesco
Gender:male
Location:Milan
Country:ITItaly (Italia)
Contact:

Re: Change to flag BBCode

Postby OldBoring » 2017-08-16, 6:04

Nobody cares aboot Kneeyidiuhn English eh.

User avatar
Yserenhart
Posts:782
Joined:2009-11-09, 2:56
Country:BEBelgium (België / Belgique)

Re: Change to flag BBCode

Postby Yserenhart » 2017-08-16, 7:52

dEhiN wrote:It seems though that the complex flag codes don't work anymore, using either method. I've tried both en-ca and en-CA with both using a descriptive text and without, and nothing works.

They do still work; however, some image files seem to missing now, resulting in the no-flag icon instead—the text and wikipedia linking still work fine. That's nothing to do with the code change though.
Native: Derbyshire English (en-GB)/New Zealand English (en-NZ) Learning: Vlaams (nl-BE)

User avatar
linguoboy
Posts:25540
Joined:2009-08-25, 15:11
Real Name:Da
Location:Chicago
Country:USUnited States (United States)

Re: Change to flag BBCode

Postby linguoboy » 2017-08-16, 15:14

Why does the ISO 639-3 code for Osage (osa) lead to the Wikipedia article on Humahuaca?
"Richmond is a real scholar; Owen just learns languages because he can't bear not to know what other people are saying."--Margaret Lattimore on her two sons

User avatar
Yserenhart
Posts:782
Joined:2009-11-09, 2:56
Country:BEBelgium (België / Belgique)

Re: Change to flag BBCode

Postby Yserenhart » 2017-08-16, 16:01

linguoboy wrote:Why does the ISO 639-3 code for Osage (osa) lead to the Wikipedia article on Humahuaca?

Because Wikipedia redirect pages. For whatever reason, all the newly added languages are going to "{CODE} language" instead of "{EN NAME OF LANGUAGE} language".
Native: Derbyshire English (en-GB)/New Zealand English (en-NZ) Learning: Vlaams (nl-BE)

User avatar
Luís
Forum Administrator
Posts:7874
Joined:2002-07-12, 22:44
Location:Lisboa
Country:PTPortugal (Portugal)

Re: Change to flag BBCode

Postby Luís » 2017-08-16, 16:58

Yserenhart wrote:They do still work; however, some image files seem to missing now, resulting in the no-flag icon instead—the text and wikipedia linking still work fine. That's nothing to do with the code change though.


The images aren't missing. But it seems we lost some rules in decoding the language codes since yesterday's migration of langicon.php. Check issue #21 on Github. I tried to fix it, but to no avail.

Yserenhart wrote:For whatever reason, all the newly added languages are going to "{CODE} language" instead of "{EN NAME OF LANGUAGE} language".


I suppose that's because wikidirect.php is still on the old site pointing to an old lang_data file. proycon opened an issue on Github yesterday to migrate it as well.
Quot linguas calles, tot homines vales

User avatar
Yserenhart
Posts:782
Joined:2009-11-09, 2:56
Country:BEBelgium (België / Belgique)

Re: Change to flag BBCode

Postby Yserenhart » 2017-08-16, 19:01

Luís wrote:
Yserenhart wrote:They do still work; however, some image files seem to missing now, resulting in the no-flag icon instead—the text and wikipedia linking still work fine. That's nothing to do with the code change though.


The images aren't missing. But it seems we lost some rules in decoding the language codes since yesterday's migration of langicon.php. Check issue #21 on Github. I tried to fix it, but to no avail.

The simple fix for that is to copy the appropriate country flags to /phpBB3/ext/unilang/languages/styles/all/theme/images/langicons/ and give them the proper complex code. That's how it is for some of them already (ex. nl-BE).
Native: Derbyshire English (en-GB)/New Zealand English (en-NZ) Learning: Vlaams (nl-BE)

User avatar
Yserenhart
Posts:782
Joined:2009-11-09, 2:56
Country:BEBelgium (België / Belgique)

Re: Change to flag BBCode

Postby Yserenhart » 2017-08-16, 19:22

The ownflag code has also been changed, in the same manner as the flag code. Same problem, same fix, same alternatives (just with "ownflag" instead of "flag").
Native: Derbyshire English (en-GB)/New Zealand English (en-NZ) Learning: Vlaams (nl-BE)

User avatar
Luís
Forum Administrator
Posts:7874
Joined:2002-07-12, 22:44
Location:Lisboa
Country:PTPortugal (Portugal)

Re: Change to flag BBCode

Postby Luís » 2017-08-16, 19:25

Yserenhart wrote:The simple fix for that is to copy the appropriate country flags to /phpBB3/ext/unilang/languages/styles/all/theme/images/langicons/ and give them the proper complex code. That's how it is for some of them already (ex. nl-BE).


I wouldn't call that a "simple" fix, considering the amount of files involved, but it's a solution.

You'd still lose ad-hoc codes, though. Up until yesterday I could use, for instance,

Code: Select all

[flag]pt-AO[/flag]
to make the flag of Angola show up, while Angolan Portuguese is not even an option in the language list.
Quot linguas calles, tot homines vales

User avatar
Yserenhart
Posts:782
Joined:2009-11-09, 2:56
Country:BEBelgium (België / Belgique)

Re: Change to flag BBCode

Postby Yserenhart » 2017-08-16, 19:47

Luís wrote:
Yserenhart wrote:The simple fix for that is to copy the appropriate country flags to /phpBB3/ext/unilang/languages/styles/all/theme/images/langicons/ and give them the proper complex code. That's how it is for some of them already (ex. nl-BE).


I wouldn't call that a "simple" fix, considering the amount of files involved, but it's a solution.

Simple in that it's just copy-pasting and renaming, as opposed to trying to get working code.


You'd still lose ad-hoc codes, though. Up until yesterday I could use, for instance,

Code: Select all

[flag]pt-AO[/flag]
to make the flag of Angola show up, while Angolan Portuguese is not even an option in the language list.

Better to have the language-list languages working properly and lose ad-hoc codes in the short term, in my opinion. I would also say that a major national variant of a world language should definitely be in the language list.
Native: Derbyshire English (en-GB)/New Zealand English (en-NZ) Learning: Vlaams (nl-BE)

User avatar
Luís
Forum Administrator
Posts:7874
Joined:2002-07-12, 22:44
Location:Lisboa
Country:PTPortugal (Portugal)

Re: Change to flag BBCode

Postby Luís » 2017-08-16, 20:25

I fixed the code, everything should be working properly again.

I also fixed the wikipedia redirects, they should work for new languages as well.

(see)

linguoboy wrote:Why does the ISO 639-3 code for Osage (osa) lead to the

Wikipedia article on Humahuaca?


It doesn't anymore.

(osa)
Quot linguas calles, tot homines vales

User avatar
voron
Language Forum Moderator
Posts:4945
Joined:2007-07-15, 3:29
Real Name:Igor
Gender:male
Country:TRTurkey (Türkiye)

Re: Change to flag BBCode

Postby voron » 2017-08-17, 19:34

We already had a change from

Code: Select all

[flag]code[/flag]
to

Code: Select all

[flag=]code[/flag]
a few years ago, right? So we're now changing it back, meaning that some older topics which were broken should now again display the flags correctly, shouldn't they? But it doesn't seem to be the case, for example in this topic the flags are still broken:
viewtopic.php?f=11&t=37054

I wonder why...
It's interesting that if I click "quote" and "preview" on some of those older posts, the flags display correctly again.
Last edited by voron on 2017-08-17, 19:36, edited 1 time in total.

vijayjohn
Language Forum Moderator
Posts:27056
Joined:2013-01-10, 8:49
Real Name:Vijay John
Gender:male
Location:Austin, Texas, USA
Country:USUnited States (United States)
Contact:

Re: Change to flag BBCode

Postby vijayjohn » 2017-08-17, 19:36

Wait, we're changing it back? I thought it was changed to a third format this time. :hmm:
voron wrote:It's interesting that if I click "quote" and "preview" on some of those older posts, the flags display correctly again.

Maybe that's because some of the language codes have changed over the years, e.g. we now have pt-BR for Brazilian Portuguese instead of pt-br.

User avatar
voron
Language Forum Moderator
Posts:4945
Joined:2007-07-15, 3:29
Real Name:Igor
Gender:male
Country:TRTurkey (Türkiye)

Re: Change to flag BBCode

Postby voron » 2017-08-17, 19:42

vijayjohn wrote:Wait, we're changing it back?

Yeah sounds crazy right? I remember how I was upset that we broke a lot of old posts with this change, but this time I couldn't care less. :whistle:

User avatar
Luís
Forum Administrator
Posts:7874
Joined:2002-07-12, 22:44
Location:Lisboa
Country:PTPortugal (Portugal)

Re: Change to flag BBCode

Postby Luís » 2017-08-17, 20:51

voron wrote:I wonder why...
It's interesting that if I click "quote" and "preview" on some of those older posts, the flags display correctly again.


Also if you edit it. It seems they need to be reparsed, so no luck there... :cry:

vijayjohn wrote:Maybe that's because some of the language codes have changed over the years, e.g. we now have pt-BR for Brazilian Portuguese instead of pt-br.


Just changed it to be case insensitive, so now for instance both pt-br and pt-BR will work.
Quot linguas calles, tot homines vales

User avatar
dEhiN
Posts:6828
Joined:2013-08-18, 2:51
Real Name:David
Gender:male
Location:Toronto
Country:CACanada (Canada)
Contact:

Re: Change to flag BBCode

Postby dEhiN » 2017-08-18, 3:16

Luís wrote:
vijayjohn wrote:Maybe that's because some of the language codes have changed over the years, e.g. we now have pt-BR for Brazilian Portuguese instead of pt-br.


Just changed it to be case insensitive, so now for instance both pt-br and pt-BR will work.

Oh yay, I'm glad! I used to use en-ca but found that wasn't working anymore, so I put en-CA. But now I can be lazy again! :D
Native: (en-ca)
Active: (fr)(es)(pt-br)(ta-lk)(mi)(sq)(tl)
Inactive: (de)(ja)(yue)(oj)(id)(hu)(pl)(tr)(hi)(zh)(sv)(ko)(no)(it)(haw)(fy)(nl)(nah)(gl)(ro)(cy)(oc)(an)(sr)(en_old)(got)(sux)(grc)(la)(sgn-us)

User avatar
Bubulus
Posts:7647
Joined:2008-08-14, 2:55
Gender:male
Country:CACanada (Canada)

Re: Change to flag BBCode

Postby Bubulus » 2017-08-27, 19:50

You guys don't know how mortified I feel for having pushed the use of flags to identify languages years ago. Regret and shame, that's what I feel.

:cry: :cry: :cry:

My thinking now is that it was actually better to just use the names of the languages, like this:

Portuguese: um dente
Spanish: un diente
Catalan: una dent
French: une dent
Italian: un dente
Romanian: un dinte

User avatar
linguoboy
Posts:25540
Joined:2009-08-25, 15:11
Real Name:Da
Location:Chicago
Country:USUnited States (United States)

Re: Change to flag BBCode

Postby linguoboy » 2017-08-28, 2:41

Same. I'm not at all fond of how it reinforces the myth of one country = one language.
"Richmond is a real scholar; Owen just learns languages because he can't bear not to know what other people are saying."--Margaret Lattimore on her two sons

User avatar
md0
Posts:8188
Joined:2010-08-08, 19:56
Country:DEGermany (Deutschland)
Contact:

Re: Change to flag BBCode

Postby md0 » 2017-08-28, 6:21

Maybe what could happen is that the flag BBCode generates a different HTML output, and not an image. So we keep the shorthand, but we get rid of the flags.

Something like [Native Lang Name] + [Lang Code: English Name Tooltip].

Code: Select all

<dfn><abbr title="pt-BR: Brazilian Portuguese">Português do Brasil</abbr></dfn>


You'd see Português do Brasil, and if you hover over it, then you'll see pt-BR: Brazilian Portuguese as a tooltip.
"If you like your clause structure, you can keep your clause structure"
Stable: Cypriot Greek (el-cy)Standard Modern Greek (el)English (en) Current: Standard German (de)
Legacy: France French (fr)Japanese (ja)Standard Turkish (tr)Elementary Finnish (fi)Netherlands Dutch (nl)


Return to “Unilang - Information, Input, and Questions”

Who is online

Users browsing this forum: No registered users and 20 guests

cron