Skip to content

Commit

Permalink
DevLangCodeRetriever: Adjust property-id used for language code (#546)
Browse files Browse the repository at this point in the history
This was changed in production to use the broader coverage provided by IETF code, see T348923.

Bug: T348923
Co-authored-by: Lucas Werkmeister <lucas.werkmeister@wikimedia.de>
  • Loading branch information
micgro42 and lucaswerkmeister authored Oct 23, 2023
1 parent 9fe3271 commit a02b386
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/NewLexemeForm.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ describe( 'NewLexemeForm', () => {

cy.intercept( { query: { action: 'wbgetclaims' } }, {
claims: {
P218: [ {
P305: [ {
mainsnak: {
snaktype: 'value',
property: 'P218',
property: 'P305',
hash: 'faa942355921695b9fa30805f0bb66bc7ed5a433',
datavalue: {
value: 'en-gb',
Expand Down
4 changes: 2 additions & 2 deletions src/data-access/DevLangCodeRetriever.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ export default class DevLangCodeRetriever implements LangCodeRetriever {
const response = await fetch( 'https://www.wikidata.org/w/api.php?' + new URLSearchParams( {
action: 'wbgetclaims',
entity: itemId,
property: 'P218',
property: 'P305',
props: '',
format: 'json',
origin: '*',
} ) ).then( ( r ) => r.json() ) as WbGetClaimsResponse;

return processWbGetClaimsResponse( response, 'P218' );
return processWbGetClaimsResponse( response, 'P305' );
}
}

0 comments on commit a02b386

Please sign in to comment.