Compare commits
	
		
			No commits in common. "f260da35944c45a6033b319c814f6ded38cb170b" and "144e43d1640fb96621443a9fb11ed63956391d87" have entirely different histories.
		
	
	
		
			f260da3594
			...
			144e43d164
		
	
		
					 1 changed files with 6 additions and 16 deletions
				
			
		
							
								
								
									
										22
									
								
								setup.sh
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								setup.sh
									
										
									
									
									
								
							| 
						 | 
					@ -883,36 +883,26 @@ cat <<'SCRIPT_END' > ../translate.sh
 | 
				
			||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
set -e
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 0.1 Change to the project directory (where docker-compose.yml is located)
 | 
				
			||||||
cd "$(dirname "$0")/steam-gift-manager"
 | 
					cd "$(dirname "$0")/steam-gift-manager"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
declare -a locales=("de" "en")
 | 
					declare -a locales=("de" "en")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 1. POT-Datei aktualisieren
 | 
				
			||||||
docker-compose run --rm steam-manager pybabel extract -F babel.cfg -o translations/messages.pot .
 | 
					docker-compose run --rm steam-manager pybabel extract -F babel.cfg -o translations/messages.pot .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 2. PO files for each language
 | 
				
			||||||
for lang in "${locales[@]}"; do
 | 
					for lang in "${locales[@]}"; do
 | 
				
			||||||
  po_path="translations/${lang}/LC_MESSAGES/messages.po"
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  if [ -f "$po_path" ]; then
 | 
					 | 
				
			||||||
    encoding=$(file -i "$po_path" | grep -Po 'charset=\K.+')
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    if [[ "$encoding" != "utf-8" ]]; then
 | 
					 | 
				
			||||||
      echo "Konvertiere $po_path von $encoding nach UTF-8"
 | 
					 | 
				
			||||||
      iconv -f "$encoding" -t UTF-8 "$po_path" > "$po_path.utf8"
 | 
					 | 
				
			||||||
      mv "$po_path.utf8" "$po_path"
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
  fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  docker-compose run --rm steam-manager pybabel update \
 | 
					  docker-compose run --rm steam-manager pybabel update \
 | 
				
			||||||
    -i translations/messages.pot \
 | 
					    -i translations/messages.pot \
 | 
				
			||||||
    -d translations \
 | 
					    -d translations \
 | 
				
			||||||
    -l "$lang" \
 | 
					    -l $lang --previous
 | 
				
			||||||
    --previous
 | 
					 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 3. Compile MO files (without fuzzy entries)
 | 
				
			||||||
docker-compose run --rm steam-manager pybabel compile -d translations
 | 
					docker-compose run --rm steam-manager pybabel compile -d translations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo "✅ Setup and/or update translations done! YOLO"
 | 
					echo "✅ Translations successfully updated!"
 | 
				
			||||||
 | 
					 | 
				
			||||||
SCRIPT_END
 | 
					SCRIPT_END
 | 
				
			||||||
chmod +x ../translate.sh
 | 
					chmod +x ../translate.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue