Bram's Dev Blog

home

100 Days of Code Day 97 - Po concerns

07 Dec 2018

Fixing broken build from yesterday

As the very first thing to try, my colleagues said to throw away node_modules with yarn clean, followed by a re-run of yarn install.

Package-lock.json found

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

Yarn upgraded + node installation

Got a message that yarn was two minor versions behind, installed it with brew, and turned out it also brought in a new version of node that was also installed with brew.

I had two versions of node installed, and the new install wasn’t able to (over)write the symlinks that brew created. So I unlinked node@6 and used brew link –overwrite node to link this latest version.

But which node still reveals a v8 of node. I also have nvm (node version manager) installed and now wondering again what the interplay/compatibility is between node installed through brew, and node installed & managed through NVM.

Anyway, the build works again

The initial hint was a good one and now the build works again. I’m continuing with the .po concerns alleviating discussed yesterday.

Dealing with length

Right now, the news on the homepage is not internationalised at all, and also not split off into some configuration. So using that as the demonstrator.

Home page news translated without IDs

I have escaped the single quote in the last message. And IntelliJ IDEA is also complaining about the unfinished string. Let’s see how I can translate these …

Despite the complaint, it does work flawlessly. In the translation files, you don’t need to deal with new lines, you can simply continue on then next line.

<li>capture and describe digital material using a submission workflow module, or a variety of programmatic
      ingest options
      </li>

Translating this in .po

msgid "capture and describe digital material using a submission workflow module, "
"or a variety of programmatic ingest options"
msgstr "digitale materialen te vangen en beschrijven, gebruik makend van een invoer werkstroom module, "
"of een variatie aan progammatische invoer mogelijkheden"

Dealing with special characters

Let’s try to put DSpace between double quotes in the welcome message.

2.3.3. Escape sequences is pretty clear on this

Escaping in Angular

In angular, you need to escape the single quotes

<li>distribute an organisation\</li>

You can just leave them as is in the .po and .pot files

msgid "distribute an organisation\'s digital assets over the web through a search and retrieval system"
msgstr "de digitale materialen van \'n organisatie over het web te distribueren "
"dankzij een zoek en terughaal systeem"

Escaping in .po and .pot

In .po and .pot, you need to escape the double quotes

<h1 class="display-3">Welcome to "DSpace"</h1>
msgid "Welcome to \"DSpace\""
msgstr "Welkom in \"DSpace\""

How does the context field/string work exactly ?

TODO tomorrow

Day 98 Plan

Make a demonstrator that uses two exactly the same strings, but uses the context support in .po. Investigate why some message keys were missing from the automated extraction.

Future days - DSpace 7 Angular

Future days - Analyzer.atmire.com work

Future Days - Productivity

Future days - Jekyll http://bram-atmire.github.io/ site

Future Days - Atmire.com work

Investigate and work on search engine optimization (SEO) for the main atmire.com website. Look into web.dev from google for this (thank you Philip)

Future Days - Learning just for learning

Sustainability challenge - Finish before Christmas

If I continue like October, I could hit day 68 by end of October and day 98 by end of November.