Page MenuHomePhabricator

Template:Birth date and age not working on pa.wikipedia
Closed, InvalidPublic

Description

Error

Template:Birth date and age does not calculate the age on Punjabi Wikipedia. I had copied that template from English wiki, it shows the birth date but does not calculate the age and shows "Expression error: Unrecognized punctuation character "�"."
Another Template that i copied was Death date and age works perfectly fine. Can anyone help me with this.

I have used the template on my Sandbox in Punjabi Wiki and attached a picture of it.

Here's the link to my Sandbox https://pa.wikipedia.org/wiki/%E0%A8%B5%E0%A8%B0%E0%A8%A4%E0%A9%8B%E0%A8%82%E0%A8%95%E0%A8%BE%E0%A8%B0:Satdeep_gill/%E0%A8%95%E0%A9%B1%E0%A8%9A%E0%A8%BE_%E0%A8%96%E0%A8%BE%E0%A8%95%E0%A8%BE

Here the link to the template https://pa.wikipedia.org/wiki/%E0%A8%AB%E0%A8%B0%E0%A8%AE%E0%A8%BE:Birth_date_and_age

Another link to template:Age
https://pa.wikipedia.org/w/index.php?title=%E0%A8%AB%E0%A8%B0%E0%A8%AE%E0%A8%BE:Age&action=edit


Version: unspecified
Severity: normal

Attached:

Screenshot_(1).png (900×1 px, 338 KB)

Details

Reference
bz62096

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:07 AM
bzimport set Reference to bz62096.
bzimport added a subscriber: Unknown Object (MLST).

This has nothing to do with bugzilla, so I will close this bug. It is the template code that is wrong. If you track the problem, you will find that the problem comes from {{age}}. The reason it fails is because {{CURRENTYEAR}} is in Punjabi language, and it can't be used in math expression. I'm wondering if there is an easy way to convert numbers in foreign language to normal numbers easily, though.

(In reply to Sorawee Porncharoenwase from comment #1)

expression. I'm wondering if there is an easy way to convert numbers in
foreign language to normal numbers easily, though.

You can create a template for this such as on bn.wp[1] or hi.wp[2]. The latter is based on a lua module.

[1]: https://bn.wikipedia.org/wiki/%E0%A6%9F%E0%A7%87%E0%A6%AE%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A7%87%E0%A6%9F:Bn2endigits

[2]: https://hi.wikipedia.org/wiki/%E0%A4%B8%E0%A4%BE%E0%A4%81%E0%A4%9A%E0%A4%BE:%E0%A4%85%E0%A4%82%E0%A4%95_%E0%A4%AA%E0%A4%B0%E0%A4%BF%E0%A4%B5%E0%A4%B0%E0%A5%8D%E0%A4%A4%E0%A4%A8

lua/template to normalize numbers is what I think in the first place, but it is inconvenient, as we have to use it to normalize numbers all the time.

@Siddhartha Ghai: Use magic word {{formatnum:...|R}} is better.

Thank You Everyone, I used the Template and the Module used in Hindi Wikipedia and now everything is perfectly fine.

[No bug fix in a codebase involved that was not on-wiki only, hence restoring "INVALID" status - on-wiki scripts/gadgets/templates are not handled in Bugzilla; but I'm glad that you found out how to fix it!]