mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 16:44:50 +00:00
commit
657175366f
4 changed files with 92 additions and 18 deletions
74
app/Console/Commands/ExportLanguages.php
Normal file
74
app/Console/Commands/ExportLanguages.php
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
class ExportLanguages extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'i18n:export';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Build and export js localization files.';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
if(config('app.env') !== 'local') {
|
||||||
|
$this->error('This command is meant for development purposes and should only be run in a local environment');
|
||||||
|
return Command::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = base_path('resources/lang');
|
||||||
|
$langs = [];
|
||||||
|
|
||||||
|
foreach (new \DirectoryIterator($path) as $io) {
|
||||||
|
$name = $io->getFilename();
|
||||||
|
$skip = ['vendor'];
|
||||||
|
if($io->isDot() || in_array($name, $skip)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($io->isDir()) {
|
||||||
|
array_push($langs, $name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$exportDir = resource_path('assets/js/i18n/');
|
||||||
|
$exportDirAlt = public_path('_lang/');
|
||||||
|
|
||||||
|
foreach($langs as $lang) {
|
||||||
|
$strings = \Lang::get('web', [], $lang);
|
||||||
|
$json = json_encode($strings, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
|
||||||
|
$path = "{$exportDir}{$lang}.json";
|
||||||
|
file_put_contents($path, $json);
|
||||||
|
$pathAlt = "{$exportDirAlt}{$lang}.json";
|
||||||
|
file_put_contents($pathAlt, $json);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Command::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
|
@ -12,7 +12,7 @@
|
||||||
"unshare": "Teilen r\u00fcckg\u00e4ngig",
|
"unshare": "Teilen r\u00fcckg\u00e4ngig",
|
||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
"copyLink": "Link kopieren",
|
"copyLink": "Link kopieren",
|
||||||
"delete": "Delete",
|
"delete": "L\u00f6schen",
|
||||||
"error": "Fehler",
|
"error": "Fehler",
|
||||||
"errorMsg": "Etwas ist schief gelaufen. Bitter versuch es sp\u00e4ter nochmal.",
|
"errorMsg": "Etwas ist schief gelaufen. Bitter versuch es sp\u00e4ter nochmal.",
|
||||||
"oops": "Hoppla!",
|
"oops": "Hoppla!",
|
||||||
|
@ -42,12 +42,12 @@
|
||||||
"drive": "Drive",
|
"drive": "Drive",
|
||||||
"settings": "Einstellungen",
|
"settings": "Einstellungen",
|
||||||
"compose": "Neu erstellen",
|
"compose": "Neu erstellen",
|
||||||
"about": "About",
|
"about": "\u00dcber uns",
|
||||||
"help": "Help",
|
"help": "Hilfe",
|
||||||
"language": "Language",
|
"language": "Sprache",
|
||||||
"privacy": "Privacy",
|
"privacy": "Privatsph\u00e4re",
|
||||||
"terms": "Terms",
|
"terms": "Terms",
|
||||||
"backToPreviousDesign": "Go back to previous design"
|
"backToPreviousDesign": "Zur\u00fcck zum vorherigen Design"
|
||||||
},
|
},
|
||||||
"directMessages": {
|
"directMessages": {
|
||||||
"inbox": "Posteingang",
|
"inbox": "Posteingang",
|
||||||
|
@ -71,12 +71,12 @@
|
||||||
"dm": "dm",
|
"dm": "dm",
|
||||||
"groupPost": "group post",
|
"groupPost": "group post",
|
||||||
"modlog": "modlog",
|
"modlog": "modlog",
|
||||||
"post": "post",
|
"post": "Beitrag",
|
||||||
"story": "story"
|
"story": "story"
|
||||||
},
|
},
|
||||||
"post": {
|
"post": {
|
||||||
"shareToFollowers": "Share to followers",
|
"shareToFollowers": "Share to followers",
|
||||||
"shareToOther": "Share to other",
|
"shareToOther": "Mit anderen teilen",
|
||||||
"noLikes": "No likes yet",
|
"noLikes": "No likes yet",
|
||||||
"uploading": "L\u00e4dt hoch"
|
"uploading": "L\u00e4dt hoch"
|
||||||
},
|
},
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
"spam": "Spam",
|
"spam": "Spam",
|
||||||
"sensitive": "Sensitiver Inhalt",
|
"sensitive": "Sensitiver Inhalt",
|
||||||
"abusive": "Abusive or Harmful",
|
"abusive": "Abusive or Harmful",
|
||||||
"underageAccount": "Underage Account",
|
"underageAccount": "Minderj\u00e4hrigen-Konto",
|
||||||
"copyrightInfringement": "Urheberrechtsverletzung",
|
"copyrightInfringement": "Urheberrechtsverletzung",
|
||||||
"impersonation": "Impersonation",
|
"impersonation": "Impersonation",
|
||||||
"scamOrFraud": "Scam or Fraud",
|
"scamOrFraud": "Scam or Fraud",
|
||||||
|
|
|
@ -16,7 +16,7 @@ return [
|
||||||
|
|
||||||
'cancel' => 'Abbrechen',
|
'cancel' => 'Abbrechen',
|
||||||
'copyLink' => 'Link kopieren',
|
'copyLink' => 'Link kopieren',
|
||||||
'delete' => 'Delete',
|
'delete' => 'Löschen',
|
||||||
'error' => 'Fehler',
|
'error' => 'Fehler',
|
||||||
'errorMsg' => 'Etwas ist schief gelaufen. Bitter versuch es später nochmal.',
|
'errorMsg' => 'Etwas ist schief gelaufen. Bitter versuch es später nochmal.',
|
||||||
'oops' => 'Hoppla!',
|
'oops' => 'Hoppla!',
|
||||||
|
@ -57,14 +57,14 @@ return [
|
||||||
'compose' => 'Neu erstellen',
|
'compose' => 'Neu erstellen',
|
||||||
|
|
||||||
// Nav footer
|
// Nav footer
|
||||||
'about' => 'About',
|
'about' => 'Über uns',
|
||||||
'help' => 'Help',
|
'help' => 'Hilfe',
|
||||||
'language' => 'Language',
|
'language' => 'Sprache',
|
||||||
'privacy' => 'Privacy',
|
'privacy' => 'Privatsphäre',
|
||||||
'terms' => 'Terms',
|
'terms' => 'Terms',
|
||||||
|
|
||||||
// Temporary links
|
// Temporary links
|
||||||
'backToPreviousDesign' => 'Go back to previous design'
|
'backToPreviousDesign' => 'Zurück zum vorherigen Design'
|
||||||
],
|
],
|
||||||
|
|
||||||
'directMessages' => [
|
'directMessages' => [
|
||||||
|
@ -94,13 +94,13 @@ return [
|
||||||
'dm' => 'dm',
|
'dm' => 'dm',
|
||||||
'groupPost' => 'group post',
|
'groupPost' => 'group post',
|
||||||
'modlog' => 'modlog',
|
'modlog' => 'modlog',
|
||||||
'post' => 'post',
|
'post' => 'Beitrag',
|
||||||
'story' => 'story',
|
'story' => 'story',
|
||||||
],
|
],
|
||||||
|
|
||||||
'post' => [
|
'post' => [
|
||||||
'shareToFollowers' => 'Share to followers',
|
'shareToFollowers' => 'Share to followers',
|
||||||
'shareToOther' => 'Share to other',
|
'shareToOther' => 'Mit anderen teilen',
|
||||||
'noLikes' => 'No likes yet',
|
'noLikes' => 'No likes yet',
|
||||||
'uploading' => 'Lädt hoch',
|
'uploading' => 'Lädt hoch',
|
||||||
],
|
],
|
||||||
|
@ -136,7 +136,7 @@ return [
|
||||||
'spam' => 'Spam',
|
'spam' => 'Spam',
|
||||||
'sensitive' => 'Sensitiver Inhalt',
|
'sensitive' => 'Sensitiver Inhalt',
|
||||||
'abusive' => 'Abusive or Harmful',
|
'abusive' => 'Abusive or Harmful',
|
||||||
'underageAccount' => 'Underage Account',
|
'underageAccount' => 'Minderjährigen-Konto',
|
||||||
'copyrightInfringement' => 'Urheberrechtsverletzung',
|
'copyrightInfringement' => 'Urheberrechtsverletzung',
|
||||||
'impersonation' => 'Impersonation',
|
'impersonation' => 'Impersonation',
|
||||||
'scamOrFraud' => 'Scam or Fraud',
|
'scamOrFraud' => 'Scam or Fraud',
|
||||||
|
|
Loading…
Reference in a new issue