SELECT "messagekey",
MAX(CASE WHEN ("locale"='de') THEN "messagecontent" ELSE null END ) AS de,
MAX(CASE WHEN ("locale"='ru') THEN "messagecontent" ELSE null END ) AS ru,
MAX(CASE WHEN ("locale"='en') THEN "messagecontent" ELSE null END ) AS en
FROM "translations" GROUP BY "messagekey";
+------------+--------------------------+---------------------------+-----------------------+
| messagekey | de | ru | en |
+------------+--------------------------+---------------------------+-----------------------+
| key1 | text auf Deutsch | текст на русском | text in english |
| key2 | andere text auf Deutsch | другой текст на русском | other text in english |
+------------+--------------------------+---------------------------+-----------------------+
// https://mvnrepository.com/artifact/org.telegram/telegrambots
compile group: 'org.telegram', name: 'telegrambots', version: '4.4.0.2'
<!-- https://mvnrepository.com/artifact/org.telegram/telegrambots -->
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>4.4.0.2</version>
</dependency>
public class User {
private int id;
}
@Repository
public interface UserRepository extends CrudRepository<User, Long> { }
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
}
@ID
& @GeneratedValue(strategy = GenerationType.AUTO)
@Component
public class Messages {
@Autowired
private MessageSource messageSource;
private MessageSourceAccessor accessor;
@PostConstruct
private void init() {
accessor = new MessageSourceAccessor(messageSource, LocaleContextHolder.getLocale());
}
public String get(String code) {
return accessor.getMessage(code);
}
}
@Autowired
private Messages messages;
messages.get("info.md7.urodocs.models.enums.Sex.MAN")
@Value
или @ConfigurationProperties
в данном случае.info.test.models.enums.Sex.MAN = мужчина
info.test.models.enums.Sex.WOMAN = женщина
но создание кнопок, текстовых полей, размеры окна я делал в графическом окружении. Неужели в Java нужно все элементы прописывать вручную?