mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 10:18:13 +00:00 
			
		
		
		
	i18n: Fix bug where package-level variables are not translated.
The call to `i18n.LoadTranslations` needs to occur on init so that package-level variables that call `i18n.T()` to initialize their values will be able to receive the translated string. Added new integration tests to test help output translation.
This commit is contained in:
		| @@ -83,8 +83,7 @@ if [[ "${generate_pot}" == "true" ]]; then | ||||
|   # shellcheck disable=SC2046 | ||||
|   go-xgettext -k=i18n.T $(grep -lr "i18n.T" "${KUBECTL_FILES[@]}" | grep -vE "${KUBECTL_IGNORE_FILES_REGEX}") > tmp.pot | ||||
|   perl -pi -e 's/CHARSET/UTF-8/' tmp.pot | ||||
|   perl -pi -e 's/\\\(/\\\\\(/g' tmp.pot | ||||
|   perl -pi -e 's/\\\)/\\\\\)/g' tmp.pot | ||||
|   perl -pi -e 's/\\(?!n"\n|")/\\\\/g' tmp.pot | ||||
|   kube::util::ensure-temp-dir | ||||
|   if msgcat -s tmp.pot > "${KUBE_TEMP}/template.pot"; then | ||||
|     mv "${KUBE_TEMP}/template.pot" "${TRANSLATIONS}/kubectl/template.pot" | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user
	 Brian Pursley
					Brian Pursley