Bram's Dev Blog

home

DSpace 7 - PO transition

22 Dec 2018

Coding in Poland

Went to bed at 7pm yesterday night. Got up at 1.30am. Drove 1100km to Poland. My girlfriend is off with her mother and sister for shopping. Her father doesn’t speak enough English and I don’t speak enough Polish to get more than a very basic conversation going so I’m turning to …

Yarn lock conflicts

The master branch of DSpace 7 Angular has been upgraded to Angular 6, but I have additional dependencies as part of the language work that are not in the standard DSpace yarn.lock file, causing conflicts. For now, I have committed my lock file locally, but this will be a merge conflict to be resolved later.

Also noticed I still had NGX Transate Extract installed in the package.json of the project locally, that was initially used to extract message keys. Removing this again as I’m not sure it will still be needed or useful going forward.

Work on the patfile for repren batch message key replacement

Given that I previously found that it worked well for a single string replace, I’m now building a pattern file (patfile) the entire message catalog.

The key “title”

Skipping the key “title” rename to DSpace as this message key is likely too generic and would potentially match too much.

search.description

That key currently has no translation in the en.po file. Have to figure out later where this is used.

First go with the patfile

Did a first run on the codebase, changing 59 files at once with my first full patfile. You can see the results in this published commit

Changes of labels in ts files instead of html files

In HTML files, we’re generally OK, since the message keys are replaced right before the | translate pipe. However, I’m not 100% sure if it’s cool that the same thing happens in .ts files.

For example, item.page.collections changing into “Collections” in collections.component.ts

Another example in a routing module

Longest possible matching patterns should come FIRST in the patfile

The patfile had these replace instructions:

item.page.files	Files
item.page.filesection.description	Description:
item.page.filesection.download	Download
item.page.filesection.format	Format:

The problem was that the first of these patterns matched all of the following. As a result,

item.page.filesection.description

Was replaced with

Filesection.description

instead of being replaced by “Description:”

Messed up imports

There were also cases of parts of import statements being equal to specific message keys.

Cleaned up what I could fix

Made manual fixes for the problems above and published these changes.

TODO

Now that the keys have been replaced with the English original messages, the .po files for Czech, German and Dutch also have to be updated so that the strings don’t appear anymore. Should be a piece of cake with another repren replace.

DSpace 7 Angular

Analyzer.atmire.com work

Productivity

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

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)

Learning just for learning