Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Where do I change the language of the app?

#2606
Avatar photo[anonymous]

Well, after some Powershell fun last night I managed to create a custom translated Publii app (v. 0.36) on my Windows 10 machine!

It was not that difficult (for me), altough it was quite labor intensive.

Here’s some tips and gotchas for other people who may wish to do that (for fun or out of necessity):

1) Make sure you’re on a Windows 64 bit machine. I tried to build the app on an older PC I had here and the app just wouldn’t build.

2) Download the app’s source code from Github and unzip it. You can translate the app texts inside the app/src/components folder. To do that, open each .vue file in a code editor (not with Word of something like that), edit the texts as you see fit and save the files. For this task, I recommend VSCode editor (from Microsoft, completely free), Notepad++ or something similar.

3) If your language has accent marks, you will need to encode the special characters inside the texts (e.g: the word “publicación”, becomes “publicación”). For some reason words with accent marks appear garbled on the final app without this encoding. To do that encoding in VSCode, install a free extension called “HTML accented character converter”. It applies this automatically on the whole file.

4) After translating the files, follow the instructions to build the app from the Publii’s wiki. Obviously, you will need familiarity with the Windows command line to do all this. This may be off putting for some people, but I learned a lot during the process. It was quite fun! I used the standard Powershell app to do that.

5) With the Powershell window opened you will issue commands to install the packages necessary to build the app, mainly using the Node.js (e.g: npm install electron@8.2.0 -g). It’s important to install the exact versions of the software as they recommend. To install a specific version of Node.js, install first the NVM (Node Version Manager) for Windows, so you can choose the exact version of Node.js they recommend (I used Node version 10.20.1).

6) I had an issue with the block editor module during the build process. After fiddling a little bit, I discovered that you need to manually donwload the Block Editor’s source code from Github, unzip it and put it inside the main Publii souce code folder, changing it’s path in the package.json file inside the /app folder, like that:

# Find:
"publii-block-editor": "github:dziudek/publii-block-editor#master",

# Replace:
"publii-block-editor": "../publii-block-editor-master",

7) Also, the command npm run prepare-editor didn’t work for me (it looks that it’s just for Unix systems), so I had to copy the directories as stated in their tutorial.

8) After that, the app building process went well and I was able to generate the custom app.

Obviously, this is an experiment and you can’t count on the Publii team to support your custom version. Do that at your onw risk.

Even being able to create a custom app, I would love to see an option to translate the interface integrated into the Publii app itself.

As a tool that aims to ease the creation of a blog, it makes sense the be able to choose the app’s language.

I hope this can help someone out there!