mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Update translate task (#5283)
- Allow for skipping of building static files - CI workflow does not have node / etc / installed
This commit is contained in:
		
							
								
								
									
										2
									
								
								.github/workflows/translations.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/translations.yml
									
									
									
									
										vendored
									
									
								
							@@ -34,7 +34,7 @@ jobs:
 | 
				
			|||||||
          invoke install
 | 
					          invoke install
 | 
				
			||||||
      - name: Make Translations
 | 
					      - name: Make Translations
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          invoke translate
 | 
					          invoke translate --skip-static
 | 
				
			||||||
      - name: Commit files
 | 
					      - name: Commit files
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
 | 
					          git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								tasks.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								tasks.py
									
									
									
									
									
								
							@@ -223,8 +223,8 @@ def translate_stats(c):
 | 
				
			|||||||
    c.run(f'python3 {path}')
 | 
					    c.run(f'python3 {path}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@task(post=[translate_stats, static])
 | 
					@task(post=[translate_stats])
 | 
				
			||||||
def translate(c):
 | 
					def translate(c, skip_static=False):
 | 
				
			||||||
    """Rebuild translation source files. Advanced use only!
 | 
					    """Rebuild translation source files. Advanced use only!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Note: This command should not be used on a local install,
 | 
					    Note: This command should not be used on a local install,
 | 
				
			||||||
@@ -234,6 +234,10 @@ def translate(c):
 | 
				
			|||||||
    manage(c, "makemessages --all -e py,html,js --no-wrap")
 | 
					    manage(c, "makemessages --all -e py,html,js --no-wrap")
 | 
				
			||||||
    manage(c, "compilemessages")
 | 
					    manage(c, "compilemessages")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not skip_static:
 | 
				
			||||||
 | 
					        # Update static files
 | 
				
			||||||
 | 
					        static(c)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@task
 | 
					@task
 | 
				
			||||||
def backup(c):
 | 
					def backup(c):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user