Quantcast

Language code property does not identify "no" as a supported language code

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Language code property does not identify "no" as a supported language code

Simon Schlosser
Hi all,

I've got the requirement to use <no> as a language code for the special poperty language code. But I am facing the issue that I only got the error message <'no' was not recognized as a supported language code>. Starting from this I was searching where the supported language codes are defined.

I found e.g. languages/SMW_Aliases.php or in /i18n the various json-documents with i18n-content. I even created everywhere, where I thought that the values are read from,  content for <no>. For example in SMW_Aliases or in i18n a json named no.json. Nothing solved the issue.

My simple question: How to add a language code to the property language code?

Thanks,
Simon

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Language code property does not identify "no" as a supported language code

kghbln
Heiya Simon,

you will probably rather go with "nb" or "nn" since MediaWiki core
itself does not support "no". Apart form that SMW already has system
messages for "nb" [0] and "nn". These messages are provided via
translatewiki.net. Manual translation via pull requests following this
schema [2]. I also suggest to upgrade SMW on your instance since you
appear to be using an outdated version.

Special property checks against IETF language tag so I believe that they
do not recognize "no" as a valid variation either.

Cheers Karsten

[0]
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nb.json
[1]
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nn.json
[2]
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/extra/en.json

Am 12.05.2017 um 14:28 schrieb Simon Schlosser:

> Hi all,
>
> I've got the requirement to use <no> as a language code for the special poperty language code. But I am facing the issue that I only got the error message <'no' was not recognized as a supported language code>. Starting from this I was searching where the supported language codes are defined.
>
> I found e.g. languages/SMW_Aliases.php or in /i18n the various json-documents with i18n-content. I even created everywhere, where I thought that the values are read from,  content for <no>. For example in SMW_Aliases or in i18n a json named no.json. Nothing solved the issue.
>
> My simple question: How to add a language code to the property language code?
>
> Thanks,
> Simon
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Language code property does not identify "no" as a supported language code

Simon Schlosser
Hey Karsten,

thanks! So there wouldn't be a fast local workaround to make it possible to assign "no" to Property:Language_code? Unfortunately, it is no option to use "nn" or "nb" instead, as the receiving applications require "no".

I am wondering, why the MW core contains the "no"-Tag here: https://github.com/wikimedia/mediawiki/blob/master/languages/data/Names.php
This seems to have no relevance for the language code property, or? It relies solely on codes defined in the SMW extension, right?

"no" is also an IETF language tag, see here: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes However, I am no expert on Norwegian :)

What I tried is to just copy i18n/nb.json as no.json. This seems to be not enough to make it acceptable for the property. Any other idea or am I just running in the wrong direction? It is only about the property as I use it to manage different language variants for terms that I define on seperate wiki article pages, respectively as subobjects on these pages. No need for Norwegian i18n of any content/messages in the wiki.

The other option would be to manage a different property by myself, such as "lang code" with having the allowed language tags via "allowed values" defined ... but I'd really like to avoid this.

Best,
Simon


-----Ursprüngliche Nachricht-----
Von: [[kgh]] [mailto:[hidden email]]
Gesendet: Freitag, 12. Mai 2017 15:02
An: [hidden email]
Betreff: Re: [Semediawiki-user] Language code property does not identify "no" as a supported language code

Heiya Simon,

you will probably rather go with "nb" or "nn" since MediaWiki core itself does not support "no". Apart form that SMW already has system messages for "nb" [0] and "nn". These messages are provided via translatewiki.net. Manual translation via pull requests following this schema [2]. I also suggest to upgrade SMW on your instance since you appear to be using an outdated version.

Special property checks against IETF language tag so I believe that they do not recognize "no" as a valid variation either.

Cheers Karsten

[0]
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nb.json
[1]
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nn.json
[2]
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/extra/en.json

Am 12.05.2017 um 14:28 schrieb Simon Schlosser:

> Hi all,
>
> I've got the requirement to use <no> as a language code for the special poperty language code. But I am facing the issue that I only got the error message <'no' was not recognized as a supported language code>. Starting from this I was searching where the supported language codes are defined.
>
> I found e.g. languages/SMW_Aliases.php or in /i18n the various json-documents with i18n-content. I even created everywhere, where I thought that the values are read from,  content for <no>. For example in SMW_Aliases or in i18n a json named no.json. Nothing solved the issue.
>
> My simple question: How to add a language code to the property language code?
>
> Thanks,
> Simon
>
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Language code property does not identify "no" as a supported language code

James HK
Hi,

> thanks! So there wouldn't be a fast local workaround to make it possible to
> assign "no" to Property:Language_code? Unfortunately, it is no option to use
> "nn" or "nb" instead, as the receiving applications require "no".

As for Property:Language_code, first we convert any user input with
the help of wfBCP47 [0] and later ask MediaWiki (
`Language::isSupportedLanguage` [1] ) to tell us whether it is a
supported language or not using the language code as identifying
factor.

We rely on MediaWiki to tell us that "no" is a supported language but
maybe a better method is Language::isKnownLanguageTag instead of
Language::isSupportedLanguage [1].

If you can confirm that and create an issue, I maybe be able to do a
quick follow-up during my weekend sprint.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/Localizer.php#L225

[1] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/Localizer.php#L203-L212

Cheers

On 5/12/17, Simon Schlosser <[hidden email]> wrote:

> Hey Karsten,
>
> thanks! So there wouldn't be a fast local workaround to make it possible to
> assign "no" to Property:Language_code? Unfortunately, it is no option to use
> "nn" or "nb" instead, as the receiving applications require "no".
>
> I am wondering, why the MW core contains the "no"-Tag here:
> https://github.com/wikimedia/mediawiki/blob/master/languages/data/Names.php
> This seems to have no relevance for the language code property, or? It
> relies solely on codes defined in the SMW extension, right?
>
> "no" is also an IETF language tag, see here:
> https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes However, I am no
> expert on Norwegian :)
>
> What I tried is to just copy i18n/nb.json as no.json. This seems to be not
> enough to make it acceptable for the property. Any other idea or am I just
> running in the wrong direction? It is only about the property as I use it to
> manage different language variants for terms that I define on seperate wiki
> article pages, respectively as subobjects on these pages. No need for
> Norwegian i18n of any content/messages in the wiki.
>
> The other option would be to manage a different property by myself, such as
> "lang code" with having the allowed language tags via "allowed values"
> defined ... but I'd really like to avoid this.
>
> Best,
> Simon
>
>
> -----Ursprüngliche Nachricht-----
> Von: [[kgh]] [mailto:[hidden email]]
> Gesendet: Freitag, 12. Mai 2017 15:02
> An: [hidden email]
> Betreff: Re: [Semediawiki-user] Language code property does not identify
> "no" as a supported language code
>
> Heiya Simon,
>
> you will probably rather go with "nb" or "nn" since MediaWiki core itself
> does not support "no". Apart form that SMW already has system messages for
> "nb" [0] and "nn". These messages are provided via translatewiki.net. Manual
> translation via pull requests following this schema [2]. I also suggest to
> upgrade SMW on your instance since you appear to be using an outdated
> version.
>
> Special property checks against IETF language tag so I believe that they do
> not recognize "no" as a valid variation either.
>
> Cheers Karsten
>
> [0]
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nb.json
> [1]
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nn.json
> [2]
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/extra/en.json
>
> Am 12.05.2017 um 14:28 schrieb Simon Schlosser:
>> Hi all,
>>
>> I've got the requirement to use <no> as a language code for the special
>> poperty language code. But I am facing the issue that I only got the error
>> message <'no' was not recognized as a supported language code>. Starting
>> from this I was searching where the supported language codes are defined.
>>
>> I found e.g. languages/SMW_Aliases.php or in /i18n the various
>> json-documents with i18n-content. I even created everywhere, where I
>> thought that the values are read from,  content for <no>. For example in
>> SMW_Aliases or in i18n a json named no.json. Nothing solved the issue.
>>
>> My simple question: How to add a language code to the property language
>> code?
>>
>> Thanks,
>> Simon
>>
>> ----------------------------------------------------------------------
>> -------- Check out the vibrant tech community on one of the world's
>> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most engaging
> tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Language code property does not identify "no" as a supported language code

James HK
Hi

The discussion is now being tacked with [0] and any additional
comments should be added to [0].

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/2455

Cheers

On 5/13/17, James HK <[hidden email]> wrote:

> Hi,
>
>> thanks! So there wouldn't be a fast local workaround to make it possible
>> to
>> assign "no" to Property:Language_code? Unfortunately, it is no option to
>> use
>> "nn" or "nb" instead, as the receiving applications require "no".
>
> As for Property:Language_code, first we convert any user input with
> the help of wfBCP47 [0] and later ask MediaWiki (
> `Language::isSupportedLanguage` [1] ) to tell us whether it is a
> supported language or not using the language code as identifying
> factor.
>
> We rely on MediaWiki to tell us that "no" is a supported language but
> maybe a better method is Language::isKnownLanguageTag instead of
> Language::isSupportedLanguage [1].
>
> If you can confirm that and create an issue, I maybe be able to do a
> quick follow-up during my weekend sprint.
>
> [0]
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/Localizer.php#L225
>
> [1]
> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/Localizer.php#L203-L212
>
> Cheers
>
> On 5/12/17, Simon Schlosser <[hidden email]> wrote:
>> Hey Karsten,
>>
>> thanks! So there wouldn't be a fast local workaround to make it possible
>> to
>> assign "no" to Property:Language_code? Unfortunately, it is no option to
>> use
>> "nn" or "nb" instead, as the receiving applications require "no".
>>
>> I am wondering, why the MW core contains the "no"-Tag here:
>> https://github.com/wikimedia/mediawiki/blob/master/languages/data/Names.php
>> This seems to have no relevance for the language code property, or? It
>> relies solely on codes defined in the SMW extension, right?
>>
>> "no" is also an IETF language tag, see here:
>> https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes However, I am no
>> expert on Norwegian :)
>>
>> What I tried is to just copy i18n/nb.json as no.json. This seems to be
>> not
>> enough to make it acceptable for the property. Any other idea or am I
>> just
>> running in the wrong direction? It is only about the property as I use it
>> to
>> manage different language variants for terms that I define on seperate
>> wiki
>> article pages, respectively as subobjects on these pages. No need for
>> Norwegian i18n of any content/messages in the wiki.
>>
>> The other option would be to manage a different property by myself, such
>> as
>> "lang code" with having the allowed language tags via "allowed values"
>> defined ... but I'd really like to avoid this.
>>
>> Best,
>> Simon
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: [[kgh]] [mailto:[hidden email]]
>> Gesendet: Freitag, 12. Mai 2017 15:02
>> An: [hidden email]
>> Betreff: Re: [Semediawiki-user] Language code property does not identify
>> "no" as a supported language code
>>
>> Heiya Simon,
>>
>> you will probably rather go with "nb" or "nn" since MediaWiki core itself
>> does not support "no". Apart form that SMW already has system messages
>> for
>> "nb" [0] and "nn". These messages are provided via translatewiki.net.
>> Manual
>> translation via pull requests following this schema [2]. I also suggest
>> to
>> upgrade SMW on your instance since you appear to be using an outdated
>> version.
>>
>> Special property checks against IETF language tag so I believe that they
>> do
>> not recognize "no" as a valid variation either.
>>
>> Cheers Karsten
>>
>> [0]
>> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nb.json
>> [1]
>> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/nn.json
>> [2]
>> https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/i18n/extra/en.json
>>
>> Am 12.05.2017 um 14:28 schrieb Simon Schlosser:
>>> Hi all,
>>>
>>> I've got the requirement to use <no> as a language code for the special
>>> poperty language code. But I am facing the issue that I only got the
>>> error
>>> message <'no' was not recognized as a supported language code>. Starting
>>> from this I was searching where the supported language codes are
>>> defined.
>>>
>>> I found e.g. languages/SMW_Aliases.php or in /i18n the various
>>> json-documents with i18n-content. I even created everywhere, where I
>>> thought that the values are read from,  content for <no>. For example in
>>> SMW_Aliases or in i18n a json named no.json. Nothing solved the issue.
>>>
>>> My simple question: How to add a language code to the property language
>>> code?
>>>
>>> Thanks,
>>> Simon
>>>
>>> ----------------------------------------------------------------------
>>> -------- Check out the vibrant tech community on one of the world's
>>> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Semediawiki-user mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most engaging
>> tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...