Habitica Language Randomizer

Habitica Language Randomizer is a third party tool that uses an Android Tasker app project to interact with Habitica's API to change your account's language setting. It changes your language randomly every two hours before changing it back to your preferred language in the evening.
This tool was removed from Github and TaskerNet in February 2023. Its documentation continues to be provided here for anyone who may have had it installed prior to its removal.
== Description ==
This Tasker project contains the following:
* Two profiles (conditions that, when met, will run specific Tasker tasks)
** Randomize Habitica Language, which (by default) runs the "Habitica Language Randomizer" task every two hours between 3:00 am and 8:30 pm (20:30) on your device (so at 3, 5, 7, 9, etc.), if your battery is not below 20%
** Set Back To Preference, which runs "Habitica Back to Preferred Language" at 8:45 pm (20:45)
* Two tasks (Tasker tasks, not Habitica tasks)
** Habitica Language Randomizer, which randomly selects a language from a list of all languages available for selection on any of Habitica's official clients (web, iOS, or Android) and sets your account to use that language (and optionally creates/updates a zero-gold reward with the current language in use so that you will always know without needing to go to the settings, and even if the current language isn't supported on the client you are currently using)
**Habitica Back to Preferred Language, which changes your language back to what you have set as your preferred language in the project-level variables (and updates the language task, if that option is enabled for the project)
* One global variable, %LangTaskCreated, whose only job is to be set or unset and work with the optional task creation/update feature
* Four project-level variables, described more in-depth in the installation section, set withing the project properties
** %habiticauserid, your user ID
** %habiticaapikey, your API key
** %preferredlang, containing the (usually) two-letter code for your preferred language
** %langtask, containing your preference (yes or no) for whether you would like the project to create and update a task showing you the language your account is set to and the clients it works on
== Installation ==
To install this Tasker project and use it to randomize your language setting, you will need the following:
* An Android device that can install the Tasker app
* A version of Tasker higher than 5.11.13, released in January 2021 (earlier versions may not support the project-level variables that this project uses)
* The project, which was available at either TaskerNet or GitHub
If you use TaskerNet, you can import directly via a simple button press. Downloading from GitHub always requires the project to be imported manually.
Upon importing, you will see popups that ask you to give values for the following variables:
Habitica Lang Randomizer UUID import.png|Dialog for entering UUID on import
Habitica Lang Randomizer key import.png|Dialog for entering API key on import
Habitica Language Randomizer preflang import en.png|Dialog for entering the preferred language on import, set to US English, the tool's default
Habitica Lang Randomizer preflang import pirate.png|Dialog for entering preferred language on import, set to Pirate English
Habitica Language Randomizer langtask import q.png|Dialog for selecting whether to create and update a reward with information when this tool runs
Habitica Lang Randomizer Tasker Properties.png|Properties screen where project variables can be edited instead of or after import dialog setup
* Your user ID, which will populate the %habiticauserid project variable. If you use Tasker-habitrpg with the same account you would like to randomize, you can enter %HabitrpgUserid as the value, and that will cause Tasker to grab your user ID from the global variable that tool uses.
* Your API key, which will populate the %habiticaapikey project variable. If you use Tasker-habitrpg with the same account you would like to randomize, you can enter %HabitrpgApiToken as the value, and that will cause Tasker to grab your API key from the global variable that tool uses. As this tool runs locally on your device, this key will not be shared or stored anywhere except in your local Tasker app, to be used to access the API.
* Preferred language, which will populate the %preferredlang project variable. This variable is only used in the Tasker task that runs at 8:45pm to set your language back to the default for the rest of the night. Valid entries for this variable (generally two-letter codes) can be found in the first column of the table below.
* Listing current language on the task page, which will populate the %langtask variable. This variable controls whether or not the project will create and update a zero-gold reward for you which will list the current language your account is set to, the clients that support it, and the date and time the language was last changed by the tool. It expects a "yes" or a "no", and the task creation and updating code will run if the variable is set to anything that includes the letters "es" next to each other.
If you do not receive popups upon import (or if the popups disappear before you have finished putting in the correct information) and you know your Tasker version supports project variables, long press the project name at the bottom of the Tasker screen and choose "Properties", then fill the value fields with the values required.
=== Language list ===
The table below lists every language this tool supports, with its code (needed for the tool), its name in English, its name as written in the language itself, and its availability, on the web, iOS, and/or Android. It is sortable so that you can sort the columns (i.e. to sort languages in proper alphabetical order, to sort the column for a client to see which languages are available and which aren't). If a language is not available on a certain client, the client should fall back to US English.
Language code (code used to set your account to the appropriate language)	Language name (English)	Language name (native/in Habitica)	Website	iOS	Android
en ("source" language all other translations are based on) 	English (US) 	English 	Yes 	Yes	Yes
bg 	Bulgarian 	Български 	Yes 	Yes	Yes
cs 	Czech 	Čeština 	Yes 	Yes	No
da 	Danish 	Dansk 	Yes 	Yes	No
de 	German 	Deutsch 	Yes 	Yes	Yes
en@pirate 	Pirate English 	Pirate English 	Yes 	No 	No
en_GB 	English (UK) 	British English 	Yes 	No 	Yes
es 	Spanish 	Español 	Yes 	Yes	Yes
es_419 	Spanish (Latin America)	Español (Latinoamérica) 	Yes 	No 	No
fr 	French 	Français 	Yes 	Yes	Yes
he 	Hebrew 	עברית 	Yes 	Yes	Yes
hr 	Croatian 	Hrvatski 	No 	Yes	Yes
hu 	Hungarian 	Magyar 	Yes 	No 	No
id 	Indonesian 	Bahasa Indonesia 	Yes 	No 	Yes
it 	Italian 	Italiano 	Yes 	Yes	Yes
ja 	Japanese 	日本語 	Yes 	Yes	Yes
ko 	Korean 	한국어 	No 	No 	Yes
nl 	Dutch 	Nederlands 	Yes 	Yes	Yes
pl 	Polish 	Polski 	Yes 	Yes	Yes
pt 	Portuguese 	Português (Portugal) 	Yes 	No 	Yes
pt_BR 	Brazilian Portuguese 	Português (Brasil) 	Yes 	Yes	Yes
ro 	Romanian 	Română 	Yes 	Yes	No
ru 	Russian 	Русский 	Yes 	Yes	Yes
sk 	Slovak 	Slovenský 	Yes 	No 	No
sr 	Serbian 	Srpski 	Yes 	No 	No
sv 	Swedish 	Svenska 	Yes 	No 	No
tr 	Turkish 	Türkçe 	Yes 	No 	Yes
uk 	Ukranian 	Українська 	Yes 	No 	No
zh 	Simplified Chinese 	中文（简体） 	Yes 	Yes	Yes
zh_TW 	Traditional Chinese 	中文（繁體） 	Yes 	No 	Yes
== Usage ==
The tasks in this project will run automatically whenever the profiles that cause them to run are triggered. If you would like to change the default times or conditions at which these run (i.e. to change the hours it runs or to make it run more or less frequently), you can tap on the "context" (the condition that can trigger the task) in the profile to edit it, or long press a context for more options.
If you would like to use the Tasker tasks manually and not running at intervals, you can switch the profile(s) off and run them by entering the task and pressing the play button. (You can also run the tasks manually anytime, even if you keep the profiles enabled and running.)
== Troubleshooting ==
;The language has updated, but the website/app is the same language as before!
:Reload the website, or completely close and reopen the app. Tasker is unable to force the site to reload upon a change in language. (It could close and reopen the Android app, but it was decided not to do this in case you were actively using the app to do something at the exact time the randomizer runs in Tasker, so there would be no chance of you losing work.)
:You may find that, on the mobile app, if you don't close and reopen it, it may change language anyway, but it might not change the language properly everywhere in the app without closing and reopening the app. It is unlikely, if not impossible, for the web interface to change language without a reload, though you may find that messages with translatable text (for instance, gem or subscription gift PMs) you receive are in the new language.
;I need to change back to my preferred language, but I don't know how!
:Option 1: Go into Tasker and find the Habitica Languages project on the bottom project bar. Go to the tasks area of the project, click the "Habitica Back to Preferred Language" task, and press the play button at the bottom of the page to run it manually. This should properly change your language as well as update the language task if you have enabled that in the setup.
:Option 2 (if option 1 does not work or just if you want to change it on the website; this will not update the language task): To change language on the website, go to https://habitica.com/user/settings/site (three from the bottom on the person icon in the upper right) where you will find the language setting as the first dropdown on the left. To change the language on the Android app, the option is in Menu > Settings cog and is the second option below the red text (the logout button) on the settings page. On iOS, the language option is within the Settings > Preferences page.
;The project has stopped working! (The language has stayed the same for too long, the task listing current language has not been updated in a long time, etc.)
:Make sure that Tasker is not disabled or otherwise not running for some reason.
:Make sure that the profiles inside the project are not switched off.
:Long press the project name and check the properties to see if the project variables are still set. It's extremely unlikely for them to become unset if they have previously worked, but it's not impossible. If they are unset, it will prevent the project from properly connecting to Habitica (because it is missing your authentication information). If they are unset, setting them again should make the project work again.
:If you have made changes to the project that you can't determine how to undo, it may be best to long press the project, delete it, and re-import a fresh copy. (Deleting the project before re-importing ensures that it asks you all the questions to set the project variables to your desired settings.)
Category:Extensions, Add-Ons, and Customizations
Category:Pages with files missing alt tags