garfieldius / t3ll

Simple tool for editing TYPO3 localization files
MIT License
46 stars 0 forks source link
typo3

TYPO3 Local Lang

This is a small utility program to edit localization files in Xlif or the legacy format for TYPO3 CMS.

Installation

t3ll opens its editor inside a Google Chrome or Chromium window. If none can be found on the system, the latest version will be downloaded automatically.

Installation can be done with homebrew (macOS and Linux) or simple binary downloads:

Homebrew

Tap into garfieldius/taps and install the package t3ll:

brew tap garfieldius/taps
brew install t3ll

Binary downloads

Go to the releases page and download the right file for your system. Rename it to t3ll / t3ll.exe and put it into $PATH / %PATH%.

All binaries can be checked via gpg. The .sig files contain signatures created with the key 0D1F16703AB055AA. It is available on most common keyservers or on https://grossberger-ge.org/gpg.asc

Example:

# Import key
gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 0D1F16703AB055AA

VERSION=$(curl -sSL 'https://api.github.com/repos/garfieldius/t3ll/releases/latest' | jq -r '.tag_name')
ARCH=linux_x64

# Download binary and signature
curl -sSLo t3ll https://github.com/garfieldius/t3ll/releases/download/${VERSION}/t3ll_${ARCH}
curl -sSLo t3ll.sig https://github.com/garfieldius/t3ll/releases/download/${VERSION}/t3ll_${ARCH}.sig

# Verify
gpg --verify t3ll.sig t3ll

# Install
install -m 0755 t3ll /usr/local/bin/

Building from source

t3ll is written in go and uses node.js and yarn modules for building its frontend, so these tools need to be installed and properly configured before proceeding.

Then simply clone the repository and use make to build it:

git clone https://github.com/garfieldius/t3ll.git
cd t3ll

# This will create a production program in the current directory
make

# Install the program into /usr/local/bin
make install

Usage

t3ll is called from the command line. It takes exactly one argument: the XML or Xliff file to edit.

t3ll fr.locallang.xlf

# Legacy XML
t3ll locallang.xml

In the former case, the file can have a language prefix, or not. t3ll will automatically load all available translations within the same folder, but only those having the same base name. That is the name of the file without any language prefix. eg.: loading the file fr.locallang.xlf will also load locallang.xlf and it.locallang.xlf, but not fr.locallang_backend.xlf.

If a file does not exist, it will be created.

Only file names with a suffix / extension of .xml, .xlf, .xlif or .xliff are supported. Others will be treated as an unknown file type.

Once the file is read, the editing mask will open in a chromium or Google Chrome window. It's interface should be self-explanatory as it is very simple and reduced to the absolute minimum.

Debug logging will write verbose messages to stdout. This can be enabled with the flag -d or --debug. This flag must be set before the filename, e.g.: t3ll -d locallang.xlf

Approved translations

t3ll itself does not support to approve labels because editing and approving a label is contradictory to the process of explicitly approving a translations.

Existing approvals are kept or revoked under the following conditions:

New labels or labels without an "approved" attribute will not have it set. Only already set approvals are kept or changed.

Shortcuts

There are several shortcuts in the browser window:

Meta is Ctrl+Shift on MacOS, Alt+Shift on other systems.

When converting from XML to XLIF, the old .xml file will not be deleted, this must be done manually.

License

MIT