Where is ‘source text’ determined, using Poedit

I’m fairly new to Poedit, but I’m trying to make a translation of a WordPress theme. I think I’m slowly beginning to understand the whole I18n, l10n and po, pot and mo thing.

I’ve purchased a Poedit license and are then trying to create a new pot-file. When I choose the folder that I’m trying to translate, then it automatically sets the language that I’m trying to translate from to be English (and I haven’t chosen it). It’s an old theme, that I’ve modified and used, so some of the words on this image is english, but the theme is actually in danish.

Read More

So where do I change the language that Poedit thinks that I’m translating from?

enter image description here

Related posts

2 comments

  1. The gettext translation system assumes that the source text is always in English. There are good reasons for it, including the fact that it is the lingua franca of computing and that designing plural forms handling for any source languages would be insane. The absolutely best thing you can do is to develop your code in English.

    Consequently, the PO file format (which isn’t Poedit’s, but a standard thing) has no way to encode the source language — there’s no need, it is known to be English.

    Some developers insist on using non-English source texts anyway, against their better judgement (this is relatively common in Germany for some reason). To accommodate this, Poedit autodetects the language since 1.8 using CLD2 (i.e. the same thing Chrome uses). There’s no way to override this, because… well, see above.

    In other words, in your case, Poedit sees the source as English because it is primarily English. If it were in Danish, Poedit would detect that. Case in point: your entire screenshot (save for maybe 1 word) is in English and not Danish as you say the file is.

    There are no negative consequences to misdetected source language, except for suboptimal suggestions. Don’t worry about it.

Comments are closed.