Módulo Discussão:WikidataIB

Último comentário: 27 de junho de 2021 de Dbastro no tópico Predefinição:Mapframe/Wikidata

@Ederporto: The code on enwp was updated today to cope with centuries better - see en:Module_talk:WikidataIB#Century_date_problem. I'm not sure how to sync it here with the changes you've made, though. Please could you have a look? Thanks (and apologies that this message is in English). Mike Peel (discussão) 22h07min de 25 de setembro de 2017 (UTC)Responder

Hi, @Mike Peel:, sorry for the delay. I saw your message and went verify how to sync. It turns out that my modifications were made to deal with the dates involving the March ("março" in portuguese) month (for some reason that I don't know, the "ç" stop the concatenation and the dates get incomplete), so I copied part of the Módulo:Wikidata here. I'm currently busy with other tasks, but as soon as I finish them I'll take a deeper look at this, as well to better internationalise the module. Boa contribuições, Ederporto (discussão) 02h14min de 28 de setembro de 2017 (UTC)Responder
@Ederporto: Obrigado. If we can, it would be good to keep this synced with the enwp version apart from the internationalisation, so please see if the new enwp version fixes the issues you were seeing, or try to make changes that we can copy back to enwp if you can. (pinging @RexxS: for awareness). Thanks. Mike Peel (discussão) 23h21min de 28 de setembro de 2017 (UTC)Responder
@Ederporto: Desculpe, eu não falo português. In the first instance, the only necessary change to remove errors would be to add a makeOrdinal function, perhaps at line 100 in this module. This is it in English:
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above:
-- takes cardinal numer as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
local function makeOrdinal (cardinal)
	local ordsuffix = i18n.ordinal.default
	if cardinal % 10 == 1 then
		ordsuffix = i18n.ordinal[1]
	elseif cardinal % 10 == 2 then
		ordsuffix = i18n.ordinal[2]
	elseif cardinal % 10 == 3 then
		ordsuffix = i18n.ordinal[3]
	end
	-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
	-- similarly for 12 and 13, etc.
	if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
		ordsuffix = i18n.ordinal.default
	end
	return tostring(cardinal) .. ordsuffix
end
The body of the function needs to build the rules to change from an integer to the ordinal in portuguese. For you, I think it may be as simple as:
local function makeOrdinal (cardinal)
	return tostring(cardinal)  .. 'º'
end
Does that help? --RexxS (discussão) 02h01min de 29 de setembro de 2017 (UTC)Responder
Hi, @RexxS e Mike Peel:, I'm studying the code of the module and my considerations are: We need this to work in portuguese, the community is debating about this little issues of dates and units. For most parts, the module works, but the dates involving march and centuries (even with the new update) don't (march in portuguese is março, the ç breaks everything and the centuries are writen like this: "Século XXI" and "Século IV a.C."). I think the internationalization it's above sync in this case, even more because the sync wouldn't fix the centuries in portuguese. I'll work int that now. Thanks for your messages and concern! Ederporto (discussão) 02h15min de 29 de setembro de 2017 (UTC)Responder
You could try:
(Line 59:)
		[7] = "Século $1",            -- precision: century
...
(Line 100:)
local roman = {'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI', 'XXII', 'XXIII', 'XXIV', 'XXV', 'XXVI', 'XXVII', 'XXVIII', 'XXIX'}
...
(line 141
		era = mw.ustring.gsub(i18n.datetime[7], "$1", roman[card])
That ought to give you "Século I" to "Século XXIX". For the "a.C" part, search en:Module:WikidataIB for the i18n["BC"] additions which would allow you to substitute "a.C". --RexxS (discussão) 02h46min de 29 de setembro de 2017 (UTC)Responder

Wikidata editar

@Ederporto e Dbastro: Olá! Estou com um problema com {{Dados da pandemia de COVID-19}} onde os dados da Índia estão sendo obtidos via Wikidata na Wiki-en, utilizando esses comandos:

{{wdib|ps=1|P1603|qid=Q84055514|list=p-1}}
{{wdib|ps=1|P1120|qid=Q84055514|list=p-1}}
{{wdib|ps=1|P8010|qid=Q84055514|list=p-1}}

Entretanto não consegui reproduzir a mesma função aqui. Como não domino muito bem o Wikidata... Help? ━ ALBERTOLEONCIO Who, me? 21h59min de 4 de junho de 2020 (UTC)Responder

Predefinição:Mapframe/Wikidata editar

@Dbastro: sua última edição no módulo parece ter quebrado a predefinição {{Mapframe/Wikidata}}, que agora marca todos os lugares do universo como estando em São José dos Campos (-23.00028, -46.00064). Poderia verificar o que aconteceu? --ArgonSim (contatoajuda) 21h40min de 27 de junho de 2021 (UTC)Responder

@ArgonSim eu tinha detetado um problema na predefinição {{Info/Museu/Wikidata}} que parecia estar ligado a essa parte de mostrar um mapa na info caixa, depois de corrigir a chamada ao Módulo:Coordenadas parecia que estava bem. Eu vou verificar os afluentes da predefinição e ver se consigo melhorar. Dbastro (discussão) 21h48min de 27 de junho de 2021 (UTC)Responder
Regressar à página "WikidataIB".