Skip to content
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

xSQLServer: Localization should change to align with HQRM modules #205

Closed
johlju opened this issue Nov 19, 2016 · 7 comments
Closed

xSQLServer: Localization should change to align with HQRM modules #205

johlju opened this issue Nov 19, 2016 · 7 comments
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Nov 19, 2016

Today localization strings in one place. We should change this so that the localization is in each of the resources. This would align with the HQRM modules.

Module example:
Resource: MSFT_WindowsOptionalFeature
Resource strings: MSFT_WindowsOptionalFeature.strings.psd1

It uses a another approach to get the localization strings`and has a helper function under the DscResources tree.
https://github.com/PowerShell/PSDscResources/blob/dev/DscResources/CommonResourceHelper.psm1

And getting the localization strings is done like this.

Write-Verbose -Message ($script:localizedData.PowerPlanIsActive -f $Name)

throw ($script:localizedData.PowerPlanNotFound -f $Name)

With this approach we will also resolve a lot of the PSSA rule warnings during testing in AppVeyor (see issue #203) when Write-Verbose is not used in the Get-/Set-/Test-methods. If we use this approach we don't have to suppress those rules and we are closer to HQRM.

@johlju
Copy link
Member Author

johlju commented Nov 23, 2016

Status of localization (according to new approach) for each resource

  • MSFT_xSQLServerAlias
  • MSFT_xSQLServerAlwaysOnService
  • MSFT_xSQLServerAvailabilityGroupListener
  • MSFT_xSQLServerConfiguration
  • MSFT_xSQLServerDatabase
  • MSFT_xSQLServerDatabaseOwner
  • MSFT_xSQLServerDatabasePermissions
  • MSFT_xSQLServerDatabaseRecoveryModel
  • MSFT_xSQLServerDatabaseRole
  • MSFT_xSQLServerEndpoint
  • MSFT_xSQLServerEndpointPermission
  • MSFT_xSQLServerEndpointState
  • MSFT_xSQLServerFirewall
  • MSFT_xSQLServerLogin
  • MSFT_xSQLServerMaxDop
  • MSFT_xSQLServerMemory
  • MSFT_xSQLServerNetwork
  • MSFT_xSQLServerPermission
  • MSFT_xSQLServerReplication
  • MSFT_xSQLServerRole
  • MSFT_xSQLServerRSConfig
  • MSFT_xSQLServerRSSecureConnectionLevel
  • MSFT_xSQLServerScript
  • MSFT_xSQLServerSetup
  • MSFT_xWaitForAvailabilityGroup

@johlju johlju added the help wanted The issue is up for grabs for anyone in the community. label Nov 27, 2016
This was referenced Jun 6, 2017
@johlju
Copy link
Member Author

johlju commented Jun 6, 2017

I created a issue for each resource. I'm will start working on xSQLServerSetup (issue #601) so we get the prerequisites for HQRM localization. Then it's will go faster to do the rest I think.

I close this issue now when there is an issue per resource for this.

@randomnote1
Copy link
Contributor

randomnote1 commented Jun 26, 2017

@johlju, I want to make sure I'm following correctly. Are we moving all of the localization from the module root directory to each individual resource? And then each individual resource will get its own set of localization directories? Is the following directory tree correct?

  • xSQLServer
    • < version >
      • DSCResources
        • < Resource >
          • en-US
          • < other language >
      • en-US

@johlju
Copy link
Member Author

johlju commented Jun 26, 2017

Yes you are correct. That structure is correct.
The root en-US is just for backward compatibility now.

I tried to explain that I CONTRiBUTION.md but maybe need to be clarified?

I see that xSQLServerHelper also will move to it's own folder under DSCResources later so it's localization folder follow the same structure. But think that we do that when all other resources are localized. I needed to get xSQLServerHelper localized to be able to close two issues. That's why I localized it at its current location.
And for the current localized error messages to work (with the same logic) I had to move them into xSQLServerHelper localized strings file.

@randomnote1
Copy link
Contributor

Thanks! I'll start working on getting the xSQLServerAlwaysOnAvailabilityGroupDatabaseMembership module updated. Your work in xSQLServerSetup should be a good example.

@johlju
Copy link
Member Author

johlju commented Jun 26, 2017

Also there are new helper functions to throw errors (see CONTRIBUTING.md). And for verbose and warning message we should use Write-Verbose and Write-Warning. That will get the PSSA rule warnings about Write-Verbose to go away.

@johlju
Copy link
Member Author

johlju commented Jun 26, 2017

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

No branches or pull requests

3 participants