[squeak-dev] The Trunk: System-tfel.846.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jul 28 14:53:21 UTC 2016


Tim Felgentreff uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-tfel.846.mcz

==================== Summary ====================

Name: System-tfel.846
Author: tfel
Time: 28 July 2016, 4:52:57.324263 pm
UUID: 7f191604-b02d-4e48-946a-9001cd9c6480
Ancestors: System-mt.845

various fixes for locale support

=============== Diff against System-mt.845 ===============

Item was changed:
  ----- Method: GetTextTranslator class>>availableLanguageLocaleIDs (in category 'accessing') -----
  availableLanguageLocaleIDs
  	"GetTextTranslator availableLanguageLocaleIDs"
  	| ids dirs localeDirForLang directoryNames |
  	ids := Set new.
  	dirs := Set new.
  	dirs addAll: LocaleDirsForDomain values.
  	dirs addAll: self defaultLocaleDirs.
  	dirs do: [:dir |
  		| localesDir |
  		localesDir := FileDirectory on: dir. 
  		directoryNames := [localesDir directoryNames] on: InvalidDirectoryError do: [:e | #()].
  		directoryNames
  				do: [:langDirName | 
  					| localeID  |
  					localeID := LocaleID posixName: langDirName.
  					localeDirForLang := localesDir directoryNamed: (self langDirNameForLocaleID: localeID).
  					localeDirForLang ifNotNil: [
+ 						(localeDirForLang fileNamesMatching: '*.mo') ifNotEmpty: [ids add: localeID]].
+ 					localeID hasParent ifTrue: [
+ 						localeDirForLang := localesDir directoryNamed: (self langDirNameForLocaleID: localeID parent).
+ 						localeDirForLang ifNotNil: [
+ 							(localeDirForLang fileNamesMatching: '*.mo') ifNotEmpty: [ids add: localeID parent]]].
- 						(localeDirForLang fileNamesMatching: '*.mo') ifNotEmpty: [ids add: localeID]
- 					]
  				].
  	].
  	^ids!

Item was changed:
  ----- Method: LocaleID class>>posixName: (in category 'instance creation') -----
  posixName: aString 
  	^ self
+ 		isoString: (aString copyReplaceAll: '_' with: '-')!
- 		isoString: (aString copyReplaceAll: ':=' with: '-')!

Item was changed:
  ----- Method: LocaleID>>displayName (in category 'accessing') -----
  displayName
  	"Answer a proper name to represent the receiver in GUI. 
  	 
  	The wording is provided by translations of the magic value 
  	'<language display name>'. 
  	 
  	'English' -> 'English'  
  	'German' -> 'Deutsch'  
  	"
  	| magicPhrase translatedMagicPhrase |
  	magicPhrase := '<language display name>'.
+ 	translatedMagicPhrase := NaturalLanguageTranslator translateWithoutLoading: magicPhrase toLocaleID: self.
- 	translatedMagicPhrase := GetTextTranslator translateWithoutLoading: magicPhrase toLocaleID: self.
  	^ translatedMagicPhrase = magicPhrase
  		ifTrue: [self displayLanguage]
  		ifFalse: [translatedMagicPhrase]!

Item was added:
+ ----- Method: LocaleID>>isoCountry: (in category 'accessing') -----
+ isoCountry: aValue
+ 
+ 	isoCountry := aValue!

Item was changed:
  ----- Method: LocaleID>>parent (in category 'accessing') -----
  parent
+ 	^ (self class
+ 			isoLanguage: self isoLanguage)
+ 			isoCountry: nil;
+ 			yourself!
- 	^self class isoLanguage: self isoLanguage!

Item was changed:
  ----- Method: LocaleID>>posixName (in category 'printing') -----
  posixName
  	"(LocaleID isoString: 'es-MX') posixName"
  	"(LocaleID isoString: 'es') posixName"
  	"language[_territory]"
  	^ self isoCountry
  		ifNil: [self isoLanguage]
+ 		ifNotNil: [self isoLanguage , '_' , self isoCountry]!
- 		ifNotNil: [self isoLanguage , ':=' , self isoCountry]!

Item was changed:
  ----- Method: Object>>localeChanged (in category '*System-Localization-locales') -----
  localeChanged
+ 	"Can react to changed locales"!
- 	self shouldBeImplemented!



More information about the Squeak-dev mailing list