t3ll

command module
v0.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 8 Imported by: 0

README

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:

  • If a label is set to approved and its content does not change, that approval is kept
  • If a label is approved and changed, the approval is set to "no"
  • If a "key" for labels changed, the approval is not changed. Only a change to a label itself will "revoke" the approval.

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.

  • Tab will focus the first input, jumping to the next if one is already focused. If the last input is active, the first will be focused again.
  • Shift+Tab will focus the last input, jumping to the previous if one is already focused. If the first input is active, the last will be focused again.
  • Cmd / Ctrl / Alt + s will save the file
  • Meta + ← / ↑ / ↓ / → will move the focus accordingly if a field is focused.
  • Meta + Backspace / Del will delete the focused row if a field is focused. The row below will be the new focused.
  • Meta + + will add a new row below the current if a field is focused

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

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package browser offers a type to open a chromium or google chrome browser window in app-mode with the given URL as entrypoint
Package browser offers a type to open a chromium or google chrome browser window in app-mode with the given URL as entrypoint
Package labels offes types and functions to load and save XLIFF v1 and TYPO3 locallang XML files
Package labels offes types and functions to load and save XLIFF v1 and TYPO3 locallang XML files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL