Skip to content

Frappe HR Localization Requirement for Employee Full Name Management in Chinese Environment #4410

@YC119

Description

@YC119

Is your feature request related to a problem? Please describe.

English Version

  1. Requirement Overview
    Currently, the employee full name (employee_name) management of the Frappe HR system adopts the Western name standard, which is generated by combining "first name (first_name) + middle name (middle_name) + last name (last_name)". This logic is inconsistent with the Chinese name habit of "surname + given name", and the middle name (middle_name) is rarely used in the Chinese environment, resulting in reduced practicality of the system in Chinese scenarios. This requirement aims to add a localized function for the Chinese environment. When the system language is set to Chinese or the region of the company to which the employee belongs is set to China, the full name combination logic will be automatically adjusted and the interface display will be optimized, while maintaining compatibility support for non-Chinese environments/non-Chinese employees.
  2. Requirement Background
    As an open-source human resource management system, Frappe HR supports multi-language and multi-region adaptation, but the current employee full name generation logic only follows Western name specifications and does not consider the usage habits of Chinese names. In the usage scenario of Chinese enterprises, employees need to fill in their names separately as "surname (last_name) and given name (first_name)" when entering their names, but the full name generated by the system is still "given name + surname", which is opposite to the actual Chinese address habits and easily causes confusion in name display; at the same time, the middle name (middle_name) field is almost unnecessary in Chinese names, and its display will increase operational redundancy and affect user experience. To improve the applicability of the system in the Chinese environment and meet the daily usage needs of Chinese enterprises, this localized function needs to be added.
  3. Function Objectives
  • Realize the automatic adaptation of employee full names in the Chinese environment, generate employee_name in the order of "surname (last_name) + given name (first_name)", which conforms to the usage habits of Chinese names.
  • By default, hide the middle name (middle_name) field in the Chinese environment to reduce operational redundancy and optimize interface simplicity.
  • Retain a compatibility mechanism to support the Western standard name display logic for non-Chinese environments/non-Chinese employees through a checkbox, ensuring system versatility.
  • Adapt to the existing system architecture without affecting the functions of other modules, ensuring functional stability and scalability.
  1. Applicable Scenarios
    All enterprises that use the Frappe HR system and have the system language set to Chinese, or the region of the company to which the employee belongs is set to China; Chinese enterprises with a small number of non-Chinese employees that need to switch the name display logic.
  2. Detailed Functional Requirements
    5.1 Trigger Conditions
    The Chinese name display logic is automatically enabled when any of the following conditions are met:
  • The global system language is set to Chinese (including Simplified Chinese and Traditional Chinese), referring to the Frappe system language configuration mechanism;
  • The regional information of the company to which the employee belongs is set to China (judged by the regional field on the company information configuration page);
  • If the above two conditions are met at the same time, the Chinese name display logic is still enabled by default without conflict.
    5.2 Chinese Name Logic
    After triggering the Chinese name logic, the system performs the following operations to adapt to the name processing mechanism of the Frappe HR Employee document:
  • Full name generation: The employee's full name (employee_name) is generated by combining "surname (last_name) + given name (first_name)" without splicing the middle name (middle_name); if only the surname or only the given name is filled in, the filled content is directly displayed (example: if last_name is "Zhang" and first_name is "San", then employee_name is "Zhang San").
  • Middle name hiding: On the employee information entry, editing, and detail pages, the input box and display area of the middle name (middle_name) are hidden by default, without affecting the system background data storage (the field is still retained in the background, only hidden in the front end).
  • Data compatibility: For existing employee data, if the Chinese name logic is triggered, the system automatically recalculates their employee_name (in the order of "surname + given name") without manual modification; when the employee's name is modified, the full name is updated in real time according to the new logic.
    5.3 Compatibility Mode Switch
    To adapt to the name display needs of non-Chinese employees, a checkbox is added to switch the name display logic, following the Frappe HR custom field extension specifications:
  • Checkbox position: On the employee information entry/editing page (near the name input area), add a checkbox labeled "Use Western name order" (or "Show middle name"), which is unchecked by default.
  • Effect after checking: After checking this option, the system restores the default Western name logic, that is, employee_name is generated by combining "first_name + middle_name + last_name", and the middle name (middle_name) input box is displayed at the same time to support the entry and display of the middle name.
  • Effect after unchecking: After unchecking, the Chinese name logic is restored immediately, the middle name input box is hidden, and the full name is regenerated according to "surname + given name".
  • Status memory: The status of the checkbox is bound to the employee information. When the employee information is saved, the status of the option is saved synchronously. When the employee information is edited next time, the last checked status is automatically displayed.
    5.4 Interface Adaptation
    Ensure that after the function is triggered, all pages involving the display of employee full names are synchronously adapted, complying with the Frappe HR front-end Vue component extension specifications:
  • Employee list page: The employee name column displays the full name generated according to the corresponding logic, "surname + given name" under the Chinese logic, and "given name + middle name + surname" under the Western logic.
  • Employee detail page: The name display area shows the full name according to the current logic, no content related to the middle name is displayed under the Chinese logic, and the middle name is displayed under the Western logic.
  • Other associated pages: All associated modules involving employee name display (such as approval processes, organizational structure, salary management, etc.) are synchronously adapted to the current name logic to ensure consistent display, adapting to the full-module linkage characteristics of Frappe HR.
  1. Remarks
  2. The middle_name field is still retained in the background, and only the front end hides/displays it according to the trigger conditions to ensure data compatibility and not affect the original data storage logic of the system; 2. If the regional of the company to which the employee belongs is changed or the system language is modified, the saved checkbox status of the employee remains unchanged, and only employees who have not checked the checkbox automatically adapt to the new name logic; 3. The function implementation must follow the Frappe HR multi-language support architecture to ensure consistent and accurate display of Chinese and English interfaces.

中文版本

  1. 需求概述
    目前Frappe HR系统的员工全名(employee_name)管理采用西方姓名标准,按“名(first_name)+中间名(middle_name)+姓(last_name)”的顺序组合生成,该逻辑与中文姓名“姓+名”的习惯不符,且中间名(middle_name)在中文环境中极少使用,导致系统在中文场景下的实用性降低。本需求旨在新增中文本土化适配功能,当系统语言设置为中文或员工所属公司地域设置为中国时,自动调整全名组合逻辑并优化界面显示,同时保留对非中文环境/非中国员工的兼容支持。
  2. 需求背景
    Frappe HR作为一款开源人力资源管理系统,支持多语言和多地域适配,但当前员工全名生成逻辑仅遵循西方姓名规范,未考虑中文姓名的使用习惯。在中文企业使用场景中,员工录入姓名时需按“姓(last_name)、名(first_name)”分别填写,而系统生成的全名仍为“名+姓”,与实际中文称谓习惯相反,易造成姓名展示混乱;同时,中间名(middle_name)字段在中文姓名中几乎无需使用,其显示会增加操作冗余,影响用户体验。为提升系统在中文环境下的适用性,满足中国企业的日常使用需求,需新增本次本土化功能。
  3. 功能目标
  • 实现中文环境下员工全名的自动适配,按“姓(last_name)+名(first_name)”的顺序生成employee_name,符合中文姓名使用习惯。
  • 中文环境下默认隐藏中间名(middle_name)字段,减少操作冗余,优化界面简洁度。
  • 保留兼容机制,通过勾选项支持非中文环境/非中国员工的西方标准姓名展示逻辑,确保系统通用性。
  • 适配系统现有架构,不影响其他模块功能,保证功能稳定性和可扩展性。
  1. 适用场景
    所有使用Frappe HR系统、且系统语言设置为中文,或员工所属公司地域设置为中国的企业;存在少量非中国员工、需要切换姓名展示逻辑的中文企业。
  2. 详细功能需求
    5.1 触发条件
    满足以下任一条件时,自动启用中文姓名展示逻辑:
  • 系统全局语言设置为中文(包括简体中文、繁体中文),参考Frappe系统语言配置机制;
  • 员工所属公司的地域信息设置为中国(通过公司信息配置页面的地域字段判断);
  • 若上述两个条件同时满足,仍默认启用中文姓名展示逻辑,不冲突。
    5.2 中文姓名逻辑
    触发中文姓名逻辑后,系统执行以下操作,适配Frappe HR员工文档(Employee)的姓名处理机制:
  • 全名生成:员工全名(employee_name)由“姓(last_name)+名(first_name)”组合生成,无需拼接中间名(middle_name);若仅填写姓或仅填写名,直接显示已填写的内容(例:last_name为“张”,first_name为“三”,则employee_name为“张三”)。
  • 中间名隐藏:在员工信息录入、编辑、详情页面,默认隐藏中间名(middle_name)的输入框和显示区域,不影响系统后台数据存储(后台仍保留该字段,仅前端隐藏)。
  • 数据兼容:已存在的员工数据,若触发中文姓名逻辑,系统自动重新计算其employee_name(按“姓+名”顺序),无需手动修改;修改员工姓名时,实时按新逻辑更新全名。
    5.3 兼容模式切换
    为适配非中国员工的姓名展示需求,新增勾选项用于切换姓名展示逻辑,遵循Frappe HR自定义字段扩展规范:
  • 勾选项位置:在员工信息录入/编辑页面(靠近姓名输入区域),添加“使用西方姓名顺序”(或“显示中间名”)勾选项,默认未勾选。
  • 勾选后效果:勾选该选项后,系统恢复默认西方姓名逻辑,即employee_name按“first_name + middle_name + last_name”组合生成,同时显示中间名(middle_name)输入框,支持录入和展示中间名。
  • 取消勾选效果:取消勾选后,立即恢复中文姓名逻辑,隐藏中间名输入框,重新按“姓+名”生成全名。
  • 状态记忆:勾选项的状态与员工信息绑定,保存员工信息时同步保存该选项状态,下次编辑该员工信息时,自动显示上次的勾选状态。
    5.4 界面适配
    确保功能触发后,所有涉及员工全名展示的页面均同步适配,符合Frappe HR前端Vue组件扩展规范:
  • 员工列表页:员工姓名列显示按对应逻辑生成的全名,中文逻辑下显示“姓+名”,西方逻辑下显示“名+中间名+姓”。
  • 员工详情页:姓名展示区域按当前逻辑显示全名,中文逻辑下不显示中间名相关内容,西方逻辑下显示中间名。
  • 其他关联页面:涉及员工姓名展示的所有关联模块(如审批流程、组织架构、薪资管理等),均同步适配当前姓名逻辑,确保展示一致,适配Frappe HR全模块联动特性。
  1. 备注
  2. 后台仍保留middle_name字段,仅前端根据触发条件隐藏/显示,确保数据兼容性,不影响系统原有数据存储逻辑;2. 若员工所属公司地域变更或系统语言修改,已保存的员工勾选项状态不变,仅未勾选勾选项的员工自动适配新的姓名逻辑;3. 功能实现需遵循Frappe HR多语言支持架构,确保中英文界面显示一致且准确。

Describe the solution you'd like

No response

Describe the alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions