Template talk:Doc

From Valve Developer Community
Jump to navigation Jump to search
Icon-message-48px.png
This is the discussion page of Template:Doc. To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

I really like the language bar with the flags of all available docs at the top right, but what I really don't like is that the doc language defaults to the client's language even though a doc in the client's language does not exist. It even becomes ridiculous when the page uses {{doc|nolang=1}}, such that you get a non-existent doc and you don't even get the languages bar to switch to english. Please fix? --Popcorn (talk) 18:26, 23 Jan 2023

Fixed. Actually, I was just thinking about doing this. The thing is, I'm currently working on another template that will probably get rid of 90% of the mess with languages, both in templates and documentation. If everything works, the {{{suf}}} parameter will no longer be needed anywhere. And I also removed the nolang parameter. I don't even remember why I added it. --Max34 (talk) 19:39, 23 Jan 2023
There is a problem that the template can't load the documentation of default language when the translations don't exist and using the {{{content}}} parameter. Please add support for the parameter. --1416006136 (talk) 21:52, 23 Jan 2023

The buttons and message box can not work correctly

There is a problem in the template that when your language is English, the Creating button on the right top and an empty message box before the documentation will be displayed whether the documentation exists. --1416006136 (talk) 11:36, 21 Feb 2023 (UTC)

Unless move the English documentation to …/doc/en. --1416006136 (talk) 15:55, 21 Feb 2023 (UTC)
The problem has solved by adding new parameter, {{{default-none}}} to {{uselang}}.}} --1416006136 (talk) 16:17, 21 Feb 2023
It was worth just rolling back the change from {{uilang}} to {{uselang}}. In any case, this is not important, since it is planned to switch from this template to the original template {{documentation}}. Everything will work differently in it, so there will be no need for the {{{default-none}}} parameter in {{uselang}}. --Max34 (talk) 16:28, 21 Feb 2023
Any changes in plans? --Amicdict (talk) 18:43, 4 Apr 2023 (UTC)
The new design of {{Doc}} looks good. But it will take some time to make these changes. --1416006136 (talk) 18:18, 8 Apr 2023

Bug: Extra slash "/" on "Template:(Page)/doc/" does not exist.

See image below.
Bug-Doc-template.png
Beside, docs page that are created with "/doc/" instead of "/doc", example: Template:YouTube/doc/ instead of Template:YouTube/doc would cause the {{Doc/subpage}} (documentation subpage) notice to not show up at all, unless it is "doc", without slash after it. --Kr0tchet (talk) 14:35, 29 Aug 2023

That's related to its working principle. {{Doc/subpage}} will try to check if the {{SUBPAGENAME}} is doc, or language suffixes (en, eo, de, ...). about, preload are also valid value.

  • If {{SUBPAGENAME}} is valid value, {{Doc/subpage}} will display the notice.
  • If it is not, the template will display nothing. --1416006136 (talk) 17:24, 29 Aug 2023

As for the message box with a slash after the link, that may be a bug. You can use the button "Create" to the right top to create page. --1416006136 (talk) 17:43, 29 Aug 2023

The bug should be fixed now. I have changed the parameter {{{pref}}} of {{Uselang}}. --1416006136 (talk) 18:22, 29 Aug 2023

Yea it's looking good now. --Kr0tchet (talk) 11:36, 30 Aug 2023

ULF usage question

Why is {{ulf|all-lang=1}} added? not every template has translations for every language yet, and it should be up to the page to specify what languages are used. If anything, the same logic used to detect what language translations are used in the drop-down should be used in ULF as well to show the correct flags, at least. -Equalizer, aka the better pickaxe (talk) 11:33, 23 August 2024 (PDT)

I added it to quickly be able to preview the template in any language when I encountered bunch of templates that didn't have the language flags at all and I had to add them manually. Not a best solution and I still planned to put it on some better place later so it doesn't interfere with manually picked ulf but didn't get to do it yet. Can't really detect what strings are available automatically unless string subpages had such information in the #switch and it's also good to have all the flags somewhere quickly clickable on the page --Nescius (talk) 13:29, 23 August 2024 (PDT)
Added 'String info' string to Template:Translate and Template:Doc string pages so that the translation progress can be easily retrieved from the string page. Maybe something like that would be fine. --Nescius (talk) 14:08, 23 August 2024 (PDT)

Adding a message that says its missing a String info

I don't know if its a good idea to add a message that says its missing a "String info", it only returns false if the #default is empty, if its not empty, then it returns true.

{{#if: {{{{FULLPAGENAME}}/strings|String info}} | {{{{FULLPAGENAME}}/strings|String info}} | {{Error|Missing string: String info!}} }}

Example on doc/strings:

Number of strings:16
Approximate status of translation:English (en) 100% Deutsch (de) 43.75% Español (es) 50% Esperanto (eo) 50% Hrvatski (hr) 100% 日本語 (ja) 6.25% 한국어 (ko) 6.25% Ქართული (ka) 12.5% Nederlands (nl) 6.25% Polski (pl) 6.25% Português (pt) 6.25% Português do Brasil (pt-br) 6.25% Русский (ru) 68.75% Українська (uk) 6.25% Tiếng Việt (vi) 25% 中文 (zh) 93.75% 

Example on Tdeprecated/strings:

Unrecognized string used!

Example of an empty string (used abc instead of String info):

Missing string: String info!

--N0one (talk) 14:26, 5 April 2025 (PDT)

Currently iirc the doc page simply tries to print "String info" whenever it detects /string subpage. What message is shown when String info doesn't exist on the given /string subpage purely depends on how that subpage deals with the string name parameter. Some print error and others don't. Are you asking if it's good idea to add some sort of check about this in the doc template and print error about it ? --Nescius (talk) 14:37, 5 April 2025 (PDT)
Right I think I understand now. It's impossible to check from doc template if a arbitrary string subpage does correctly define String info and instead is simply not returning its own error. Not really have an opinion on whether it should notify about String info missing or not. --Nescius (talk) 14:49, 5 April 2025 (PDT)
(aww man, another conflict :( I'm not going to write the reply again so making it short; Also it doesn't have to be an error) It randomly came up in my head on whether to add a message or not, so i decided to talk about it on adding a simple message or not. --N0one (talk) 15:07, 5 April 2025 (PDT)