Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Topic on User talk:Andytizer

Hi Andy,

I've done some thinking about the language selector template, and essentially come up with two methods of making it work right (assuming we're working by the subpage method of translations of Article and /Article/Polski)

1. Check if each language's translation page exists

This is probably the more convoluted method, but doesn't require any extensions or anything. Essentially, I create a template that contains instances of another template for each language that we want, and if the template for that language finds that Article/SubArticleWithThatLanguageName exists, it displays.

This is the method that erepublik uses. It does work, in the end, so idk. It shouldn't be that hard to sort out.

2. Use extensions to find an article's translation subpages

The other method would result in (I'm estimating) quite a bit less code, but would require two simple parser extensions that aren't on this wiki yet:

The first gives us the ability to list subpages of an article (i.e. to find all the translations of an article). The second gives us the ability to manipulate the array that the first extension produces, and format each subpage translation for the template.

Advantages? We wouldn't have to manually add each language to some back-end template, and it'd be cleaner code. If you can be arsed, I think this would be the better option, and tbh these extensions could be useful in a bunch of other templates :) Just a thought!

Cheers, JB