El diumenge, 29 de juliol de 2018, a les 21:45:27 CEST, Karl Ove Hufthammer va escriure: > Albert Astals Cid skreiv 29. juli 2018 19:31: > > Ideally one would be able to query gettext about whether the translation > > exists or not (basically having an option to return nullptr in the above > > function or similar), but I have not been able to find any such > > functionality in glibc/libintl itself or in any other library out there. > > According to comment #7 at https://bugs.kde.org/show_bug.cgi?id=168134, > this is possible: > > > > […] how to know which language did the translation came from. Turned out > > that raw gettext calls will return the same const char* pointer given to > > them if there was no translation, as opposed to different pointer if the > > translation was there, but same string-wise. Since i18n() uses these raw > > calls under the hood, by this it can check the language.
Right, that makes sense, i'll investigate. Cheers, Albert