User talk:Kenny/Archive 1: Difference between revisions

m
Line 3: Line 3:


*I see you use <nowiki>{{</nowiki>SUBPAGENAME}} for  language part. However, this is not good because sometime it does not get the correct language. (For example, El/d will give a subpage name of d, but this is not a language name. I wrote '''Template:LANGPATH''' and '''Template:LANGNAME''', which are better parsing the language names.
*I see you use <nowiki>{{</nowiki>SUBPAGENAME}} for  language part. However, this is not good because sometime it does not get the correct language. (For example, El/d will give a subpage name of d, but this is not a language name. I wrote '''Template:LANGPATH''' and '''Template:LANGNAME''', which are better parsing the language names.
*LANGNAME will give a string indicating the language name of the title given. If there is no language name, it will return default language ("en" for this wiki) instead. This template can allow maximum 1 parameter, <nowiki>{{</nowiki>LANGNAME|h/it}} will return '''it''' but {{<nowiki>{{</nowiki>LANGNAME|h/i}} will return '''en'''. If no parameters given, current page's title will be used.
*LANGNAME will give a string indicating the language name of the title given. If there is no language name, it will return default language ("en" for this wiki) instead. This template can allow maximum 1 parameter, <nowiki>{{</nowiki>LANGNAME|h/it}} will return '''it''' but <nowiki>{{</nowiki>LANGNAME|h/i}} will return '''en'''. If no parameters given, current page's title will be used.
*Like LANGNAME, LANGPATH gives the string that can be added to the end of a URL. The return string looks like /zh-hans /it and so on. If the language is default wiki language, it will return empty string. (For example, Story/Elder + a empty string, is still Story/Elder, and does not switch its language).
*Like LANGNAME, LANGPATH gives the string that can be added to the end of a URL. The return string looks like /zh-hans /it and so on. If the language is default wiki language, it will return empty string. (For example, Story/Elder + a empty string, is still Story/Elder, and does not switch its language).