Skip to content

Commit 54cd803

Browse files
committed
[WIP] WOQL.insert_data: support language tags in label/description #32
1 parent 04f920e commit 54cd803

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/query/woqlBuilder.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ WOQLQuery.prototype.domain = function(d) {
245245
}
246246

247247
WOQLQuery.prototype.label = function(l, lang) {
248+
if (typeof l !== 'string' && l['@value'] != null) {
249+
lang = l['@language']
250+
l = l['@value']
251+
}
248252
lang = lang ? lang : 'en'
249253
if (l.substring(0, 2) == 'v:') {
250254
var d = l
@@ -255,6 +259,10 @@ WOQLQuery.prototype.label = function(l, lang) {
255259
}
256260

257261
WOQLQuery.prototype.description = function(c, lang) {
262+
if (typeof c !== 'string' && c['@value'] != null) {
263+
lang = c['@language']
264+
c = c['@value']
265+
}
258266
lang = lang ? lang : 'en'
259267
if (c.substring(0, 2) == 'v:') {
260268
var d = c

0 commit comments

Comments
 (0)