Advertisement
Virajsinh

Laravel PHP Language File Generate Bat File

Nov 25th, 2024 (edited)
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.86 KB | Source Code | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4. :: Define the supported languages array
  5. set supportedLanguages=af,am,ar,az,be,bg,bn,bs,ca,cs,cy,da,de,dv,el,en,es,et,eu,fa,fi,fr,ga,gl,gu,he,hi,hr,hu,hy,id,is,it,ja,ka,kk,km,kn,ko,ky,lt,lv,mk,ml,mn,mr,ms,mt,nb,ne,nl,nn,no,or,pa,pl,ps,pt,ro,ru,sd,si,sk,sl,sq,sr,sv,sw,ta,te,th,tr,uk,ur,uz,vi,xh,zh,zu
  6.  
  7. :: Loop through each language code and create a folder and PHP file for it
  8. for %%a in (%supportedLanguages%) do (
  9.    :: Create a folder for the language if it doesn't exist
  10.     if not exist "%%a" (
  11.         mkdir "%%a"
  12.     )
  13.    
  14.     :: Create the PHP file inside the folder
  15.     echo <?php > "%%a\messages.php"
  16.     echo return [ >> "%%a\messages.php"
  17.     echo     'language' => '%%a', >> "%%a\messages.php"
  18.     echo ]; >> "%%a\messages.php"
  19.     echo %%a.php file has been created in the %%a folder.
  20. )
  21.  
  22. endlocal
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement