refactor: change text language to english

This commit is contained in:
Patryk Hegenberg 2024-12-25 08:13:41 +01:00
parent e17e071443
commit 6fcd9dbdc3

28
main.go
View file

@ -12,12 +12,12 @@ import (
func main() {
var rootCmd = &cobra.Command{
Use: "tmux_popup",
Short: "Ein CLI-Tool für verschiedene Aktionen",
Long: "tmux_popup ist ein CLI-Werkzeug, das verschiedene Aktionen wie tmux, lazygit, harlequin und postings unterstützt. Es oeffnet diese Programme in einem floating tmux pane",
Short: "A CLI tool for various actions",
Long: "tmux_popup is a CLI tool that supports various actions like tmux, lazygit, harlequin, and postings. It opens these programs in a floating tmux pane.",
}
rootCmd.PersistentFlags().String("width", "80%", "Breite des Popups (z. B. 80%)")
rootCmd.PersistentFlags().String("height", "80%", "Höhe des Popups (z. B. 80%)")
rootCmd.PersistentFlags().String("width", "80%", "Width of the popup (e.g., 80%)")
rootCmd.PersistentFlags().String("height", "80%", "Height of the popup (e.g., 80%)")
rootCmd.AddCommand(tmuxCmd)
rootCmd.AddCommand(lazygitCmd)
@ -26,14 +26,14 @@ func main() {
rootCmd.AddCommand(checkCmd)
if err := rootCmd.Execute(); err != nil {
fmt.Println("Fehler:", err)
fmt.Println("Error:", err)
os.Exit(1)
}
}
var tmuxCmd = &cobra.Command{
Use: "tmux",
Short: "Öffnet ein tmux-Popup",
Short: "Opens a tmux popup",
Run: func(cmd *cobra.Command, args []string) {
width, _ := cmd.Flags().GetString("width")
height, _ := cmd.Flags().GetString("height")
@ -43,7 +43,7 @@ var tmuxCmd = &cobra.Command{
var lazygitCmd = &cobra.Command{
Use: "lazygit",
Short: "Öffnet lazygit in einem Popup",
Short: "Opens lazygit in a popup",
Run: func(cmd *cobra.Command, args []string) {
width, _ := cmd.Flags().GetString("width")
height, _ := cmd.Flags().GetString("height")
@ -53,7 +53,7 @@ var lazygitCmd = &cobra.Command{
var harlequinCmd = &cobra.Command{
Use: "harlequin",
Short: "Öffnet harlequin in einem Popup",
Short: "Opens harlequin in a popup",
Run: func(cmd *cobra.Command, args []string) {
width, _ := cmd.Flags().GetString("width")
height, _ := cmd.Flags().GetString("height")
@ -63,7 +63,7 @@ var harlequinCmd = &cobra.Command{
var postingsCmd = &cobra.Command{
Use: "postings",
Short: "Öffnet postings in einem Popup",
Short: "Opens postings in a popup",
Run: func(cmd *cobra.Command, args []string) {
width, _ := cmd.Flags().GetString("width")
height, _ := cmd.Flags().GetString("height")
@ -73,20 +73,20 @@ var postingsCmd = &cobra.Command{
var checkCmd = &cobra.Command{
Use: "check",
Short: "Prüft die Abhängigkeiten",
Short: "Checks the dependencies",
Run: func(cmd *cobra.Command, args []string) {
if err := CheckDependencies(); err != nil {
fmt.Println("Fehler bei der Überprüfung der Abhängigkeiten:", err)
fmt.Println("Error checking dependencies:", err)
os.Exit(1)
}
fmt.Println("Alle Abhängigkeiten sind vorhanden.")
fmt.Println("All dependencies are present.")
},
}
func openPopup(sessionName, command string, width, height string) {
currentSession, err := exec.Command("tmux", "display-message", "-p", "-F", "#{session_name}").Output()
if err != nil {
fmt.Println("Fehler beim Abrufen der aktuellen Session:", err)
fmt.Println("Error retrieving the current session:", err)
return
}
@ -124,7 +124,7 @@ func CheckDependencies() error {
func runCmd(dep string, args []string) error {
cmd := exec.Command(dep, args...)
if err := cmd.Run(); err != nil {
return fmt.Errorf("Fehler beim Überprüfen von %s: %w", dep, err)
return fmt.Errorf("Error checking %s: %w", dep, err)
}
return nil
}