Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

generation mo file #22

Open
zenikd opened this issue Jan 17, 2019 · 1 comment
Open

generation mo file #22

zenikd opened this issue Jan 17, 2019 · 1 comment
Labels

Comments

@zenikd
Copy link

zenikd commented Jan 17, 2019

Hi, i have problem with generation mo file. When i add new localization (By poedit) and save it, mo file contain something like this

PO-Revision-Date: 2019-01-17 20:19+0300
Language-Team: 
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Generator: Poedit 2.0.6
X-Poedit-Basepath: ../../src
Plural-Forms: nplurals=2; plural=(n != 1);
X-Poedit-KeywordsList: gettext;ngettext:1,2;xgettext:1,2c;nxgettext:1,2,4c
X-Poedit-SourceCharset: UTF-8
Last-Translator: 
Language: en
X-Poedit-SearchPath-0: components
 username 

But in your project mo.json files contain payload in json format. How can i change save format in poedit (or another editor)?

@eugene-manuilov
Copy link
Owner

Hi @zenikd

you need to install gettextjs package by running pip3 install gettextjs in your terminal. Then you will be able to convert mo files into json files.

See the sample project here. It contains two npm commands: gettext:compile and gettext:convert. The first one converts po files into mo files, the second one converts mo files into json files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants