-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: i18n #2039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: i18n #2039
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
apps/application/migrations/0024_applicationaccesstoken_language.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Generated by Django 4.2.15 on 2025-01-20 03:20 | ||
|
|
||
| from django.db import migrations, models | ||
| import smartdoc.conf | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('application', '0023_application_stt_autosend'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='applicationaccesstoken', | ||
| name='language', | ||
| field=models.CharField(default=smartdoc.conf.Config.get_language_code, max_length=10, verbose_name='语言'), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet appears to be part of an OpenAPI schema definition for a REST API. Here are some observations and improvements:
Irregularities/Potential Issues
Duplicate
stt_model_enableProperty: The request body defines two instances of the same property ("stt_model_enable"), which might not be intended.Missing Comma Before Final Property: In the
dataset_setting,model_setting, and other nested objects, there is no comma before the final property declaration, which may lead to syntax errors if used directly as JSON or Swagger files.Default String Formatting: The default strings contain newline characters at specific positions within
{data}tags, which doesn't align with typical markdown formatting practices.Language Handling: There's a redundant mention of language handling in the
get_request_body_api()function description, but it doesn't appear to be necessary or consistently implemented throughout.Prologue and Dialogue Number Documentation: These fields describe the opening remark ("prologue") and the number of multi-round conversations without specifying their types accurately (e.g., "number").
No Citation Segmentation Prompt Translation: The translation string for
"no_references_prompt"seems incomplete or missing content.Optimization Suggestions
Simplify Default Strings: Simplify the default strings for better readability. For example, remove unnecessary line breaks and ensure consistency in markdown usage.
Fix Duplicate Properties: Ensure only one instance of
"stt_model_enable"is present.Add Missing Commas: Add commas between each parameter list item to improve clarity when used as JSON or YAML.
Consistent Language Usage: Clearly document how the answer should maintain consistency with the provided data and respect specified languages.
Here’s an optimized version of the code:
And the corresponding definition for
CreateApplicationReqschema:Replace
applicationApiDatasetSettingandapplicationModelSettingwith actual implementations or references as per your requirements. Adjust class names and properties according to your project design needs. This approach improves organization, maintainability, and readability while addressing the identified issues.