Template talk:LL

From OpenStreetMap Wiki
Jump to navigation Jump to search

Swapping all wiki links?

Is the idea of this template to swap all wiki links from a syntax like [[OpenLayers]] to a syntax like [[{{LL|OpenLayers}}|OpenLayers]]

-- Harry Wood (talk) 13:15, 16 November 2016 (UTC)

This allows simpler translations of English pages by copy pasting and still finding relevant links (English pages are first copy-pasted as is with a new languiage prefix, and translators start updating the text without taking care first of all links and chjecking all of them. This is also interesting for maintenance purpose (note that trailing characters are not supported, and should be part of the target part of the link (trailers do not work correctly with other languages, and translators have problems handling them correctly. But looking at many pages that translators made, they had problems linking to ther other translated version of target pages and were bored checking all links individually, or added prefixes or translated titles in the target, creating many red links everywhere. LL ("Localized Link") solves this problem simply in many pages.
Then these LL links can be tuned if needed per language (if the target has been translated with a new title and one wants to avoid the redirect).
From English pages (without any language prefix in their title), it has no effect, LL will just return its parameter.
Note: LL now works as well with Categories and Templates (a separate "ns=" parameter is no longer needed for the namespace). So {{LLC}} or {{LLT}} are no longer needed for categories and templates if you use {{LL}} with a parameter specifying the namespace: it may clarify the wikitext if we use {{LL}} instead.
There is NO swap: it generates the target link to a page on a wiki, the text after the pipe is the visible text of the link and is freely translatable. — Verdy_p (talk) 18:38, 16 November 2016 (UTC)
Note also: LL is preferable to keeping the link to the English article: the translated articles are frequently created later, but many translated pages forget to be updated later to use the new transalted target pages. This also simplifies the maintenance (once target pages are transalted, you may remove the LL template call by setting statically the language code in the link, but it is also needed to change the English title. Leaving LL in translated pages is the best nasd fastest option for everyone, including experienced translators or editors: readers hate to see linkg pointing to the English page when there's a matching translated page; as much as possible they will remain in their own language while navigating, without necessarily having to locate their prefered language in the languages navbar. — Verdy_p (talk) 19:04, 16 November 2016 (UTC)
OK... but the answer is "yes". You want to go through the whole wiki changing links from the simple form [[OpenLayers]] to a syntax like [[{{LL|OpenLayers}}|OpenLayers]].
There has to be a better way surely.
Maybe we can do a hack to the way our wiki works internally with links, or even not the links but the display of a page. Maybe when a Russian user lands on the "OpenLayers" page it could automatically redirect them (optionally?) to "RU:OpenLayers" if a translated page is available.
-- Harry Wood (talk) 11:51, 10 February 2017 (UTC)

Automatically adding (en) besides the link to an untranslated page

Currently the {{English}} template ((en)) is useful to aid the readers of the wiki, because (I assume) when people which do not understand english see this mark, they don't click on the related linked page and get frustrated because they can't read it.

Right now, manually adding {{English}} defeats the purpose of {{LL}}, because someone still needs to verify if the linked page has been translated or not in order to keep (or remove) the (en) mark. The solution to that would be to {{LL}} automatically add this marking if the target page has still not been translated to English.

An alternative solution is to just not use (en), which I think is not the way to go since it defeats its purpose (stated on the first paragraph of this topic).

--Dhiegov (talk) 13:26, 14 February 2019 (UTC)

Right now, manually adding {{English}} defeats the purpose of {{LL}}, because someone still needs to verify if the linked page has been translated or not in order to keep (or remove) the (en) mark.

Beyond that, it's easy to add inconsistency: Imagine if (en) does not reflect the current linked page language, because it was translated, {{LL}} then linked to the translated page, but {{English}} was not removed. --Dhiegov (talk) 13:55, 14 February 2019 (UTC)
This template is currently used on about 43000 pages, so I am not very keen to change it. It probably also contains some tweaks which I do not know about. In the past, I either used static link targets and (en) or {{LL}}. A non-optimal solution would be the creation of a new template that compares the output of LL with the input. This approach does not work on English pages though. I created a draft of such a template at User:Tigerfell/Sandbox. You can try it out at Special:ExpandTemplates (do not forget the page title). --Tigerfell This user is member of the wiki team of OSM (Let's talk) 12:19, 15 February 2019 (UTC)
Thank you for creating this draft and sorry for taking so long to answer. Even it being a draft, I quite like it, because (let's say the final template gets a name of LLen) {{LLen|Export|exportação}} is cleaner than [[ {{LL|Export}} |exportação]]. A small problem I see is that enclosing everything with {{ }}'s, occludes the fact that it renders to a link like any other text enclosed by [[ ]]'s. What do you think? Not working in English pages is ok, since that's implicit anyway.
Could you explain why changing a very popular template is server intensive? And do using templates that use a popular template increase the latter popularity (and therefore makes changing the popular template even more server intensive)? --Dhiegov (talk) 15:14, 1 March 2019 (UTC)
Well, this is due to MediaWiki (the underlying software). You enclose templates in {{ }} and internal links in [[ ]]. We could change the template easily so that it requires squared brackets as well like [[{{ }}]]. In the long run, I would like this wiki to switch to Translate extension anyway managing this differently.
Changing such a template means that the system will render all pages using this template. So, the system will fetch the wiki formatting code from its database and run it through the parser system. AFAIK it is not able to temporarily save the output of this template because it contains a parameter, so it will expand it every time anew. This is done at a scheduled time directly by the server (not necessarily immediately). I do not know a lot more about it, but I guess that it is slow because it works with text data (called BLOB) and therefore needs to iterate over every bit of the text of every page.
In addition, a change might be considered a "massive change" and this would require you to follow Automated Edits code of conduct. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 20:58, 1 March 2019 (UTC)
If using [[{{ }}]] is the solution for the link occusion, I prefer it occluded, since it goes against the simplicity stated in adhering to {{LLen|Export|exportação}} instead of [[ {{LL|Export}} |exportação]] and requires more typing of unnecessary and prone to error characters.
About the Translation extension, do you know how's the discussion going about using it in OSM's wiki?
Also, how do I start using the template draft you made? Do you plan on creating a template page for it? --Dhiegov (talk) 20:19, 4 March 2019 (UTC)
Yes, it is located at Template:LLen now. Simply write {{LLen|Export|exportação}} and you will get exportação(en).
The main discussion happened at Talk:Wiki_Translation#Translate_extension, but I guess someone would need to bring this up again. It was basically agreed upon and the setup was planned after an update of MediaWiki, but then nothing happened. There is still this trac ticket. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 13:27, 5 March 2019 (UTC)
Thank you, Tigerfell. About the extension, do you think just a reminder suffices? If not (since it's not really possible to know the future, hehe), do anyone with a wiki login can install it? If that's the case I might try to help. --Dhiegov (talk) 23:13, 5 March 2019 (UTC)
I would bring this up on Talk:Wiki and then watch what the other users say. No, installations can be done by OWG members only because you need server access which is entirely different from the wiki accounts. --Tigerfell This user is member of the wiki team of OSM (Let's talk) 09:50, 6 March 2019 (UTC)
Thanks, I got it. I'm going to do that then. --Dhiegov (talk) 11:08, 6 March 2019 (UTC)
Just did it. --Dhiegov (talk) 14:29, 6 March 2019 (UTC)