I want to get a full list of all languages included in the WPML plugin, regardless of whether or not they were active. The function icl_get_languages()
only returns languages which are active on the site, so does not work here. The language list should be returned in the language of the current locale and should be sorted however that particular language sorts words (e.g. English: A -> Z, Japanese: ア -> オ).
I did "answer your own question", the solution is below. Full credit to the following (my solution is basically just these three stuck together):
- https://stackoverflow.com/a/10000042/5374743
- https://wpml.org/forums/topic/outputting-language-tag-in-theme/
- The fellow at WPML who responded to my support ticket