forked from Elara6331/itd
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			translit-m
			...
			romanian
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f28c68438a | |||
| aa90e9eb26 | 
@@ -60,6 +60,7 @@ Since the PineTime does not have enough space to store all unicode glyphs, it on
 | 
			
		||||
- Armenian
 | 
			
		||||
- Korean
 | 
			
		||||
- Chinese
 | 
			
		||||
- Romanian
 | 
			
		||||
- Emoji
 | 
			
		||||
 | 
			
		||||
Place the desired map names in an array as `notifs.translit.use`. They will be evaluated in order. You can also put custom transliterations in `notifs.translit.custom`. These take priority over any other maps. The `notifs.translit` config section should look like this:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										9
									
								
								music.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								music.go
									
									
									
									
									
								
							@@ -22,13 +22,10 @@ import (
 | 
			
		||||
	"github.com/rs/zerolog/log"
 | 
			
		||||
	"go.arsenm.dev/infinitime"
 | 
			
		||||
	"go.arsenm.dev/infinitime/pkg/player"
 | 
			
		||||
	"go.arsenm.dev/itd/translit"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func initMusicCtrl(dev *infinitime.Device) error {
 | 
			
		||||
	player.Init()
 | 
			
		||||
	maps := k.Strings("notifs.translit.use")
 | 
			
		||||
	translit.Transliterators["custom"] = translit.Map(k.Strings("notifs.translit.custom"))
 | 
			
		||||
 | 
			
		||||
	player.OnChange(func(ct player.ChangeType, val string) {
 | 
			
		||||
		if !firmwareUpdating {
 | 
			
		||||
@@ -36,11 +33,11 @@ func initMusicCtrl(dev *infinitime.Device) error {
 | 
			
		||||
			case player.ChangeTypeStatus:
 | 
			
		||||
				dev.Music.SetStatus(val == "Playing")
 | 
			
		||||
			case player.ChangeTypeTitle:
 | 
			
		||||
				dev.Music.SetTrack(translit.Transliterate(val, maps...))
 | 
			
		||||
				dev.Music.SetTrack(val)
 | 
			
		||||
			case player.ChangeTypeAlbum:
 | 
			
		||||
				dev.Music.SetAlbum(translit.Transliterate(val, maps...))
 | 
			
		||||
				dev.Music.SetAlbum(val)
 | 
			
		||||
			case player.ChangeTypeArtist:
 | 
			
		||||
				dev.Music.SetArtist(translit.Transliterate(val, maps...))
 | 
			
		||||
				dev.Music.SetArtist(val)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
 
 | 
			
		||||
@@ -327,6 +327,24 @@ var Transliterators = map[string]Transliterator{
 | 
			
		||||
		"ÿ", "y",
 | 
			
		||||
		"ç", "c",
 | 
			
		||||
	},
 | 
			
		||||
	"Romanian": Map{
 | 
			
		||||
		"ă", "a",
 | 
			
		||||
		"Ă", "A",
 | 
			
		||||
		"â", "a",
 | 
			
		||||
		"Â", "A",
 | 
			
		||||
		"î", "i",
 | 
			
		||||
		"Î", "I",
 | 
			
		||||
		"ș", "s",
 | 
			
		||||
		"Ș", "S",
 | 
			
		||||
		"ț", "t",
 | 
			
		||||
		"Ț", "T",
 | 
			
		||||
		"ş", "s",
 | 
			
		||||
		"Ş", "S",
 | 
			
		||||
		"ţ", "t",
 | 
			
		||||
		"Ţ", "T",
 | 
			
		||||
		"„", "\"",
 | 
			
		||||
		"”", "\"",
 | 
			
		||||
	},
 | 
			
		||||
	"Emoji": Map{
 | 
			
		||||
		"😂", ":')",
 | 
			
		||||
		"😊", ":)",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user