-// Fill missing lines
-$arraySize = max(array_keys($formatted));
-$formatted = array_replace(array_fill(0, $arraySize, ''), $formatted);
-
-// Add remaining translations
-$langContent = array_filter($langContent, function($item) {
- return !is_null($item) && !empty($item);
-});
-if (count($langContent) > 0) {
- $formatted[] = '';
- $formatted[] = "\t// Unmatched";
-}
-foreach ($langContent as $key => $value) {
- if (is_array($value)) {
- $formatted[] = formatTranslationArray($key, $value);
- } else {
- $formatted[] = formatTranslationLine($key, $value);
- }
-}
-
-// Add end line
-$formatted[] = '];';
-$formatted = implode("\n", $formatted);
-
-writeLangFile($lang, $fileName, $formatted);
-
-function formatTranslationLine(string $key, string $value, int $indent = 1, int $keyPad = 1) {
+/**
+ * Format a translation line.
+ * @param string $key
+ * @param string $value
+ * @param int $indent
+ * @param int $keyPad
+ * @return string
+ */
+function formatTranslationLine(string $key, string $value, int $indent = 1, int $keyPad = 1) : string {