Skip to content

Add Chinese (zh_Hans) translations and fix media file access for single-machine deployment - #12730

Closed
chinaglowing wants to merge 4 commits into
inventree:masterfrom
chinaglowing:zh-cn-i18n-patch
Closed

Add Chinese (zh_Hans) translations and fix media file access for single-machine deployment#12730
chinaglowing wants to merge 4 commits into
inventree:masterfrom
chinaglowing:zh-cn-i18n-patch

Conversation

@chinaglowing

Copy link
Copy Markdown

Summary

This PR adds 37 missing Chinese (zh_Hans) translations and fixes media file access for single-machine deployments without a reverse proxy.

Changes

Backend translations (26 entries in django.po)

  • Stock status: OK ? ??
  • Sales/Purchase order: Discount, discount percentage hint, line item quantity
  • System settings: Edit completed transfer orders, merge purchase order line items, search results preview panel
  • Error messages: Stock item no longer exists, server reloading, missing purchase/sales order permissions
  • Parameter templates: Uniqueness options (none, per model type, global), uniqueness enforcement

Frontend translations (11 entries in messages.po)

  • Discount, Show completed line items, Show outstanding orders, No items selected, delete confirmation text
  • Direct stock, FAQ, Traceback, Filter by parts on order, render error message

Code fixes for single-machine deployment

  • middleware.py: Add MEDIA_URL to paths_own_security - media files use DRF token/session auth in single-machine mode
  • urls.py: Serve media files via django.views.static.serve outside DEBUG mode - fixes export 404 when no reverse proxy is configured

Testing

  • Verified on Windows single-machine deployment (SQLite, port 17456, no reverse proxy)
  • /api/generic/status/ returns all Chinese status labels
  • Sales order line item fields display in Chinese
  • Media file export (reports, labels) works without 404 errors

Notes

  • Targeted at commit e4b23b4 (master branch)
  • django.mo is gitignored and must be compiled separately (polib or django compilemessages)
  • Frontend requires npm run compile + npm run build after applying

@netlify

netlify Bot commented Aug 28, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit a13baeb
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a9127205216fd000876ca5e
😎 Deploy Preview https://deploy-preview-12730--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 97 (🔴 down 1 from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@matmair

matmair commented Aug 28, 2026

Copy link
Copy Markdown
Member

As per our docs translations need to be submitted on crowdin

@chinaglowing

Copy link
Copy Markdown
Author

Thanks for the pointer! I've split this PR:\n\n- Translations (37 entries): Will be submitted via Crowdin as per project guidelines\n- Code fix (media file access): Moved to #12732 which contains only the middleware/urls changes without any translation files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants