| 
									
										
										
										
											2022-06-03 01:53:16 +02:00
										 |  |  | #! /bin/bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Automerge translations automatically fetches the translations from weblate | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-03 02:02:14 +02:00
										 |  |  | git fetch weblate-github | 
					
						
							|  |  |  | git merge --no-commit weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations weblate-github/weblate-mapcomplete-core | 
					
						
							| 
									
										
										
										
											2022-06-03 01:53:16 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | npm run generate:translations | 
					
						
							|  |  |  |  if [ "$?" = "0" ]; then | 
					
						
							|  |  |  |   # Translation generation went fine - commit | 
					
						
							|  |  |  |   git add langs/ | 
					
						
							|  |  |  |   git add assets/ | 
					
						
							| 
									
										
										
										
											2022-06-03 13:41:49 +02:00
										 |  |  |   git commit -m "Merge weblate translations and regenerate translations" | 
					
						
							|  |  |  |   git push | 
					
						
							| 
									
										
										
										
											2022-06-03 01:53:16 +02:00
										 |  |  |  else | 
					
						
							|  |  |  |   echo "Generation of translations failed!" | 
					
						
							| 
									
										
										
										
											2022-06-03 13:41:49 +02:00
										 |  |  |   git merge --abort | 
					
						
							|  |  |  |  fi |