Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K Ki18n
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • Ki18n
  • Merge requests
  • !21

Add KLazyLocalizedString as a replacement for the I18N_NOOP macros

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Volker Krause requested to merge vkrause/ki18n:work/lazy-localized-string into master Oct 07, 2021
  • Overview 32
  • Commits 3
  • Pipelines 20
  • Changes 10

This is KF5-compatible, but duplicates all the ki18n methods. It's also still needing 2-5x more memory than the macro-based approach, but unlike that allows easy mixing of different variants in the same message table. It is significantly more efficient than build a message table holding KLocalizedStrings at runtime though.

A more invasive approach (source-incompatible/KF6) could be to have the existing ki18n functions return a KLazyLocalizedString, and replicate most of KLocalizedString's API in there to auto-convert on demand. Not sure yet whether that's worth it though.

Similarly more compact types for each variants that auto-convert to KLazyLocalizedString could be an option to explore to get to the same memory cost as the macro-approach, but that is probably not worth it.

This obviously still misses more docs and tests, for now this mainly about discussing the general idea.

Edited Oct 17, 2021 by Volker Krause
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: work/lazy-localized-string