Module talk:TNT

Jump to navigation Jump to search

About this board

How would one remove Module:TNT?

白龙 (talkcontribs)

Hi. I am an admin of an Wiki site in Mainland China, and we ported some modules from Mediawiki Wiki and Wikipedia (namely Module:Documentation); a lot of them depends on Module:TNT. Our wiki is small, has only one language (Chinese), and doesn't expect additional languages in the foreseeable future; thus, we don't need and don't have the skill to maintain TNT. And, the GFW makes TNT a pain as it still depends on Wikimedia (which would be blocked).

We would like to remove TNT from our port. Could anyone please point us as to how to do so? Any help is greatly appreciated.

Yurik (talkcontribs)

I don't think there is a way to "just remove it" -- every template and module uses it to localize itself, so you would have to replace every TNT usage with the actual string from the corresponding data table.

Dinoguy1000 (talkcontribs)

You mentioned you imported some things from Wikipedia; as far as I know, no Wikipedia language version makes use of Module:TNT or any similar system, so you might have some luck looking on Wikipedia for the templates/modules you need, and skipping entirely.

白龙 (talkcontribs)

Thanks! We just really liked the style of Template:Documentation on We'll just try to deal with that one and avoid and go with Wikipedia modules in the future.

This post was hidden by 白龙 (history)
Pppery (talkcontribs)
Dinoguy1000 (talkcontribs)

Aah, fair. Clearly I need to be more careful about speaking outside of my competencies. =)

Reply to "How would one remove Module:TNT?"

Provide language for doc function

Mps (talkcontribs)

Hi, I would like to change local data = loadData(dataset) to local data = loadData(dataset, frame.args.lang) in the doc function.

The reason being, I would like to be able to do:


This would allow that the TemplateData content is displayed in the language set by the user, and not by the Wikipedia language version. Currently, if a user on the German Wikipedia has set his preferred language to English, the UI as well as the TemplateData captions and so on are in English, but the the data coming from the translation dataset is in German.

I tried to use the Scribunto/Lua equivalent of {{int:lang}}, i.e."lang"):plain(), but strangely this also returns the Wikipedia content language and not the user language.

I'm specifically asking to be on the safe side as you specifically put a TODO above the line I want to change.

Yurik (talkcontribs)

@Mps hi, thx for writing. I think that TNT should use user's language as oppose to content language in very few cases. TNT produces parts of content, not parts of the user interface. So for example, if you are reading an article with a graph, you expect the text under the graph to be in the same language as the rest of the article. On the other hand, the toolbars and commands at the top should all be in the user-selected language, as that's part of the interface.

That said, I totally agree that template data may benefit from being in the interface language.

As for your question... I don't know for sure, but I have a suspicion that it was done on purpose - WMF doesn't want content to have non-content language, because that fragments the cache, and greatly increases server load. Imagine, instead of having one version of the page, WMF has to have potentially 300 the moment you add some UI-language-dependent template to it.

So, if the {{int:...}} approach works, I would simply create a template wrapper for calling TNT module. What do you think?

P.S. I also think it might be a good idea to use something like to have a simple conversion tool -- to convert existing template data to a table json format.

Mps (talkcontribs)

Hi @Yurik:, sorry for not answering earlier. Yes a wrapper template seems to be the best choice as it could also help remove the fluff, i.e. providing the method name which is always the same and even the name of the template to describe as this could also be inferred e.g. via {{#titleparts:{{PAGENAME}}|1}}, so that in most cases the user would just need to inject the TNT wrapper template without any parameters to get proper localized template data.

Regarding the PS: A converter for existing template data JSON to data table JSON would certainly be helpful. I can't really say much about as I am myself not much of of a web guy. So I don't know how much of a fitting framework it is.

Reply to "Provide language for doc function"
Mps (talkcontribs)

I think in the example Original/ should be changed to I18n/ as this looks more like the preferred way to name and mark localization resource tables.

Yurik (talkcontribs)

Thanks @Mps, agree. You are very welcome to make changes too btw :)

Reply to "Example"
There are no older topics