TranslationUpdater

public final class TranslationUpdater

Keeps a downloaded language file current, the way installed content packages are kept current.

The active language is checked shortly after startup and every 24 hours. The request carries the ETag of the copy already held, so an unchanged file costs a 304 and no body. A changed file is parsed and kept as <language>.csv.update. It is merged into the live file on the next restart or /em reload (TranslationsConfigFields), because the running plugin holds the live file in memory and writes it back.

Properties

Link copied to clipboard
public final static List<String> REMOTE_LANGUAGES
Languages published at magmaguy.com/api/elitemobs_translations/<language>.csv.

Functions

Link copied to clipboard
public static String download(String language, Path temporary, String knownEtag, BooleanSupplier cancelled)
Downloads a published language file into temporary and checks that EliteMobs can parse it.
Link copied to clipboard
public static void freshCopyInstalled(Path folder, String language, String etag)
Records a fresh copy installed by /em language: its ETag becomes the reference for update checks, and any update downloaded for the copy it replaced is obsolete.
Link copied to clipboard
public static String remoteLanguage(String languageName)
Link copied to clipboard
public static void shutdown()
Link copied to clipboard
public static void start()