-
-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Text component localization support #82
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
Conversation
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
- Rename HTML protocol to Markup for Swift API Design Guidelines compliance - Rename HTMLBuilder to MarkupBuilder with updated documentation - Rename HTMLString to MarkupString for consistency - Update AnyHTML to AnyMarkup with proper type erasure - Rename HTMLClassContainer to MarkupClassContainer - Rename HTMLContentBuilder to MarkupContentBuilder - Update all documentation to use 'markup' terminology - Rename AttributeBuilder.renderTag to buildMarkupTag for clarity - Move files from HTML/ directory to Markup/ directory
- Update all 85+ Swift files to use Markup instead of HTML types - Replace HTMLBuilder with MarkupBuilder throughout codebase - Update all protocol conformances and type annotations - Replace renderTag with buildMarkupTag method name - Update documentation to use 'markup' and 'stylesheet' terminology - Maintain backward compatibility for actual HTML tag output - All tests passing after comprehensive refactor
…idelines - CSS → StyleSheet: sanitizedForCSS() → sanitizedForStyleSheet() - URL → WebAddress: baseURL → baseWebAddress throughout APIs - XML → ExtensibleMarkupLanguageDocument: generateXML() → generateExtensibleMarkupLanguageDocument() - Improve method clarity: getData() → retrieveStructuredDataDictionary() - Improve method clarity: toJSON() → convertToJsonString() - Boolean properties to assertions: generateSitemap → shouldGenerateSitemap - Boolean properties to assertions: generateRobotsTxt → shouldGenerateRobotsTxt - Add backward compatibility aliases with deprecation warnings - Update all references across codebase and tests - All 367 tests passing with new method names
- AttributeBuilder.buildAttributes: Add clear parameter labels (identifier, styleSheetClasses, ariaRole, etc.) - StyleOperation: Add alternative methods with clearer labels (using, with configuration) - Input component: Improve event handler parameter label clarity - Add backward compatibility overloads to maintain existing API - All 254 tests passing with improved parameter clarity - Complete Swift API Design Guidelines compliance
Add comprehensive localization infrastructure for the Text component following SwiftUI patterns: - LocalizationKey: Supports string literals, interpolation, and table-based organization - LocalizationManager: Centralized singleton for managing locale and resolution - Foundation & Bundle resolvers: NSLocalizedString integration with custom bundle support - Text component enhancements: - Automatic localization key detection (snake_case, dot.notation patterns) - Explicit localization support via LocalizationKey parameter - Backward compatibility maintained for existing string initializers - Comprehensive test coverage: 20 passing tests covering all functionality Resolves #76: Text localization now works like SwiftUI with automatic key resolution
maclong9
added a commit
that referenced
this pull request
Jul 7, 2025
* Refactor core HTML protocols and builders to Markup - Rename HTML protocol to Markup for Swift API Design Guidelines compliance - Rename HTMLBuilder to MarkupBuilder with updated documentation - Rename HTMLString to MarkupString for consistency - Update AnyHTML to AnyMarkup with proper type erasure - Rename HTMLClassContainer to MarkupClassContainer - Rename HTMLContentBuilder to MarkupContentBuilder - Update all documentation to use 'markup' terminology - Rename AttributeBuilder.renderTag to buildMarkupTag for clarity - Move files from HTML/ directory to Markup/ directory * Complete HTML to Markup refactoring across entire codebase - Update all 85+ Swift files to use Markup instead of HTML types - Replace HTMLBuilder with MarkupBuilder throughout codebase - Update all protocol conformances and type annotations - Replace renderTag with buildMarkupTag method name - Update documentation to use 'markup' and 'stylesheet' terminology - Maintain backward compatibility for actual HTML tag output - All tests passing after comprehensive refactor * Expand abbreviations and improve method names per Swift API Design Guidelines - CSS → StyleSheet: sanitizedForCSS() → sanitizedForStyleSheet() - URL → WebAddress: baseURL → baseWebAddress throughout APIs - XML → ExtensibleMarkupLanguageDocument: generateXML() → generateExtensibleMarkupLanguageDocument() - Improve method clarity: getData() → retrieveStructuredDataDictionary() - Improve method clarity: toJSON() → convertToJsonString() - Boolean properties to assertions: generateSitemap → shouldGenerateSitemap - Boolean properties to assertions: generateRobotsTxt → shouldGenerateRobotsTxt - Add backward compatibility aliases with deprecation warnings - Update all references across codebase and tests - All 367 tests passing with new method names * Improve parameter labels for better call-site clarity - AttributeBuilder.buildAttributes: Add clear parameter labels (identifier, styleSheetClasses, ariaRole, etc.) - StyleOperation: Add alternative methods with clearer labels (using, with configuration) - Input component: Improve event handler parameter label clarity - Add backward compatibility overloads to maintain existing API - All 254 tests passing with improved parameter clarity - Complete Swift API Design Guidelines compliance * Implement Text component localization support Add comprehensive localization infrastructure for the Text component following SwiftUI patterns: - LocalizationKey: Supports string literals, interpolation, and table-based organization - LocalizationManager: Centralized singleton for managing locale and resolution - Foundation & Bundle resolvers: NSLocalizedString integration with custom bundle support - Text component enhancements: - Automatic localization key detection (snake_case, dot.notation patterns) - Explicit localization support via LocalizationKey parameter - Backward compatibility maintained for existing string initializers - Comprehensive test coverage: 20 passing tests covering all functionality Resolves #76: Text localization now works like SwiftUI with automatic key resolution
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
• Add comprehensive localization infrastructure for the Text component following SwiftUI patterns
• Implement automatic localization key detection for snake_case and dot.notation patterns
• Add explicit localization support via LocalizationKey parameter with interpolation
• Provide Foundation and Bundle-based resolvers for NSLocalizedString integration
• Maintain backward compatibility with existing Text string initializers
Test plan
Resolves #76