jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.57k stars 4.02k forks source link

failed to generate native language for only a single language #27884

Open flyliu33 opened 4 days ago

flyliu33 commented 4 days ago
Overview of the issue

microservice-ecommerce-store-4-apps.txt

I tried to generate project with command jhipster jdl .\microservice-ecommerce-store-4-apps.jdl --auto-crlf which configure Chinese as its native language. My jdl file includes some Chinese comment with /* / for some of the entity entries, but it cannot generate the Chinese table head for the entity vue file as expected.

no relevant errors arose.

Motivation for or Use Case

My project only need Chinese language, not the default English language.

Reproduce the error
  1. execute command jhipster jdl .\microservice-ecommerce-store-4-apps.jdl --auto-crlf
Related issues
Suggest a Fix
JHipster Version(s)

v8.7.3

JHipster configuration
    ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
    ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
    ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝

██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║ ╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗ ╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝ https://www.jhipster.tech Welcome to JHipster v8.7.3

Welcome to the JHipster Information Sub-Generator

store@0.0.0 D:\workspace\test\jhipster\ms-ecommerce-store\store
`-- (empty)
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationIndex": 0,
    "applicationType": "gateway",
    "applications": {
      "invoice": {
        "applicationIndex": 2,
        "serverPort": "8082"
      },
      "notification": {
        "applicationIndex": 3,
        "serverPort": "8083"
      },
      "product": {
        "applicationIndex": 1,
        "serverPort": "8081"
      }
    },
    "authenticationType": "jwt",
    "baseName": "store",
    "buildTool": "maven",
    "cacheProvider": "no",
    "clientFramework": "vue",
    "clientTheme": "none",
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "devServerPort": 9060,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": [
      "Customer",
      "Employee",
      "Company",
      "Product",
      "ProductType",
      "ProductCategory",
      "ProductOrder",
      "OrderItem",
      "Invoice",
      "Shipment",
      "Notification"
    ],
    "jhiPrefix": "sys",
    "jhipsterVersion": "8.7.3",
    "lastLiquibaseTimestamp": 1731570999000,
    "messageBroker": false,
    "nativeLanguage": "zh-cn",
    "packageName": "com.jhipster.demo.store",
    "prodDatabaseType": "mysql",
    "reactive": true,
    "searchEngine": false,
    "serverPort": "8080",
    "serviceDiscoveryType": "consul",
    "testFrameworks": [
      "gatling",
      "cypress"
    ],
    "websocket": false
  }
}
Environment and Tools

openjdk version "17.0.12" 2024-07-16 LTS OpenJDK Runtime Environment Corretto-17.0.12.7.1 (build 17.0.12+7-LTS) OpenJDK 64-Bit Server VM Corretto-17.0.12.7.1 (build 17.0.12+7-LTS, mixed mode, sharing)

git version 2.45.1.windows.1

node: v20.18.0 npm: 10.8.2

Docker version 27.1.1, build 6312585

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
/**
 * 客户
 */
@ChangelogDate("20241114074639")
entity Customer {
  id Long
  /**
   * 名字
   */
  firstName String required
  /**
   * 姓氏
   */
  lastName String required
  /**
   * 性别
   */
  gender Gender required
  /**
   * 电子邮件
   */
  email String required pattern(/^[^@\s]+@[^@\s]+\.[^@\s]+$/)
  /**
   * 电话
   */
  phone String required
  /**
   * 地址1
   */
  addressLine1 String required
  /**
   * 地址2
   */
  addressLine2 String
  /**
   * 城市
   */
  city String required
  /**
   * 州
   */
  state String
  /**
   * 国家
   */
  country String required
}
/**
 * 员工
 */
@ChangelogDate("20241114074739")
entity Employee {
  id Long required
  /**
   * 名字
   */
  firstName String required
  /**
   * 姓氏
   */
  lastName String required
  /**
   * 手机号码
   */
  mobileNo String maxlength(11)
  /**
   * 性别
   */
  sex Gender
}
/**
 * 公司
 */
@ChangelogDate("20241114074839")
entity Company {
  id Long required
  /**
   * 名称
   */
  name String
  /**
   * 联系人
   */
  contact String
}
/**
 * Product sold by the Online store
 */
@ChangelogDate("20241114074939")
entity Product {
  id Long
  name String required
  description String
  price BigDecimal required min(0)
  productSize Size required
  comment String
  image ImageBlob
}
/**
 * 商品类型
 */
@ChangelogDate("20241114075039")
entity ProductType {
  id Long
  /**
   * 类型名称
   */
  name String required
  /**
   * 类型描述
   */
  description String
}
@ChangelogDate("20241114075139")
entity ProductCategory {
  id Long
  name String required
  description String
}
/**
 * 订单
 */
@ChangelogDate("20241114075239")
entity ProductOrder {
  id UUID
  /**
   * 下单日期
   */
  placedDate Instant required
  /**
   * 订单状态
   */
  status OrderStatus required
  /**
   * 订单编号
   */
  code String required
  /**
   * 发票ID
   */
  invoiceId Long
  /**
   * 客户
   */
  customer String required
}
@ChangelogDate("20241114075339")
entity OrderItem {
  id UUID
  quantity Integer required min(0)
  totalPrice BigDecimal required min(0)
  status OrderItemStatus required
}
/**
 * 发票
 */
@ChangelogDate("20241114075439")
entity Invoice {
  id Long
  /**
   * 发票号码
   */
  code String required
  /**
   * 发票日期
   */
  date Instant required
  /**
   * 发票详情
   */
  details String
  /**
   * 发票状态
   */
  status InvoiceStatus required
  /**
   * 付款方式
   */
  paymentMethod PaymentMethod required
  /**
   * 付款日期
   */
  paymentDate Instant required
  /**
   * 付款金额
   */
  paymentAmount BigDecimal required
}
@ChangelogDate("20241114075539")
entity Shipment {
  id Long
  trackingCode String
  date Instant required
  details String
}
/**
 * 通知
 */
@ChangelogDate("20241114075639")
entity Notification {
  id UUID
  /**
   * 通知日期
   */
  date Instant required
  /**
   * 通知详情
   */
  details String
  /**
   * 发送日期
   */
  sentDate Instant required
  /**
   * 通知类型
   */
  format NotificationType required
  /**
   * 通知用户ID
   */
  userId Long required
  /**
   * 产品ID
   */
  productId Long required
}

/**
 * 性别
 */
enum Gender {
  MALE,
  FEMALE,
  OTHER
}
enum Size {
  S,
  M,
  L,
  XL,
  XXL
}
/**
 * 订单状态
 */
enum OrderStatus {
  COMPLETED,
  PENDING,
  CANCELLED
}
enum OrderItemStatus {
  AVAILABLE,
  OUT_OF_STOCK,
  BACK_ORDER
}
enum InvoiceStatus {
  PAID,
  ISSUED,
  CANCELLED
}
enum PaymentMethod {
  CREDIT_CARD,
  CASH_ON_DELIVERY,
  PAYPAL
}
enum NotificationType {
  EMAIL,
  SMS,
  PARCEL
}

relationship OneToOne {
  Customer{user(login) required} to User with builtInEntity
}
relationship OneToMany {
  ProductCategory{product} to Product{productCategory(name)}
  ProductOrder{orderItem} to OrderItem{order(code) required}
  Invoice{shipment} to Shipment{invoice(code) required}
}
relationship ManyToOne {
  OrderItem{product(name) required} to Product
}
relationship ManyToMany {
  Company{employee(firstName)} to Employee{company(name)}
  Product{productType(name)} to ProductType{product(name)}
}

dto Customer, Employee, Company, Product, ProductType, ProductCategory, ProductOrder, OrderItem, Invoice, Shipment, Notification with mapstruct
paginate Customer, Employee, Company, Product, ProductOrder, OrderItem, Invoice, Shipment with pagination
service Customer, Employee, Company, Product, ProductType, ProductCategory, ProductOrder, OrderItem, Invoice, Shipment, Notification with serviceClass
search Customer, Employee, Company, Product, ProductType, ProductCategory, ProductOrder, OrderItem, Invoice, Shipment, Notification with no
microservice Product, ProductCategory, ProductOrder, OrderItem with product
microservice Invoice, Shipment with invoice
microservice Notification with notification
clientRootFolder Product, ProductCategory, ProductOrder, OrderItem with product
clientRootFolder Invoice, Shipment with invoice
clientRootFolder Notification with notification

Congratulations, JHipster execution is complete! If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!

Browsers and Operating System

Edition Windows 11 Pro Version 23H2 Installed on ‎8/‎19/‎2024 OS build 22631.4391 Experience Windows Feature Experience Pack 1000.22700.1047.0

github-actions[bot] commented 14 hours ago

JHipster has completed the sample check .yo-rc.json: valid Entities JDL: valid Application: successfully generated Frontend check: failure Backend check: failure E2E check: skipped

This check uses jhipster info output from the issue description to generate the sample. Bug report that does not contain this information will be marked as invalid.