# v1.9.0 - 国际化与本地化

## 多货币支持

```go
func (s *SubscriptionManager) GetLocalizedPrice(ctx context.Context, userID int64, planID int) (*Price, error) {
    user := s.getUser(ctx, userID)
    
    // 获取用户地区货币
    currency := s.getCurrencyForRegion(user.Country)
    
    // 汇率转换
    basePrice := s.getBasePrice(planID)
    convertedPrice := s.convertCurrency(basePrice, "USD", currency)
    
    // 购买力平价调整（可选）
    adjustedPrice := s.applyPPPAdjustment(convertedPrice, user.Country)
    
    return &Price{
        Amount:   adjustedPrice,
        Currency: currency,
    }, nil
}
```

## 本地支付方式

```go
func (s *SubscriptionManager) GetLocalPaymentMethods(ctx context.Context, country string) []PaymentMethod {
    methods := map[string][]PaymentMethod{
        "CN": {
            {Name: "Alipay", Type: "ewallet"},
            {Name: "WeChat Pay", Type: "ewallet"},
            {Name: "UnionPay", Type: "card"},
        },
        "IN": {
            {Name: "UPI", Type: "bank_transfer"},
            {Name: "Paytm", Type: "ewallet"},
        },
        "BR": {
            {Name: "Pix", Type: "bank_transfer"},
            {Name: "Boleto", Type: "voucher"},
        },
    }
    
    return methods[country]
}
```

## 多语言支持

```go
func (s *SubscriptionManager) GetLocalizedContent(ctx context.Context, userID int64, key string) string {
    user := s.getUser(ctx, userID)
    
    translations := map[string]map[string]string{
        "en": {
            "upgrade_prompt": "Upgrade to Premium for more features",
        },
        "zh": {
            "upgrade_prompt": "升级到高级版解锁更多功能",
        },
        "ja": {
            "upgrade_prompt": "プレミアムにアップグレードしてさらなる機能を",
        },
    }
    
    return translations[user.Language][key]
}
```
